Solved

com dll vc6 to vc7: Can we ignore  these warnings

Posted on 2004-09-30
5
1,216 Views
Last Modified: 2013-11-25
Hi
Its a conversion of VC6 com dll into .NET 2003.  just want to know how severe are the following warnings.

LINK : warning LNK4222: exported symbol 'DllCanUnloadNow' should not be assigned an ordinal
LINK : warning LNK4222: exported symbol 'DllGetClassObject' should not be assigned an ordinal
LINK : warning LNK4222: exported symbol 'DllRegisterServer' should not be assigned an ordinal
LINK : warning LNK4222: exported symbol 'DllUnregisterServer' should not be assigned an ordinal

LINK : warning LNK4089: all references to 'SHELL32.dll' discarded by /OPT:REF
LINK : warning LNK4089: all references to 'USER32.dll' discarded by /OPT:REF

Will ignoring the above cause any  runtime problems?

Regards,
Shinto
0
Comment
Question by:yuvarani
  • 3
  • 2
5 Comments
 
LVL 3

Expert Comment

by:Santino_k
ID: 12190626
No,I don't think so. According to MSDN Remove ordinal numbers as these functions are always located by name, using GetProcAddress.

Refer the following link.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcerrLinkerToolsWarningLNK4222.asp

Hope this helps
0
 

Author Comment

by:yuvarani
ID: 12197541

Hi Santino,
      
      Thank you for your comments on LNK4222.  Just a few more queries before closing this:
      1) I got these warning in VC7. Why these warning do not seen  in VC6? Is Ordinal numbers are mandatory in VC6 ?
      2) Is there any scenario where using ordinal numbers are advantageous?
      3) There's another warning also in my initial post:  "LINK : warning LNK4089: all references to 'SHELL32.dll' discarded by /OPT:REF"

0
 
LVL 3

Accepted Solution

by:
Santino_k earned 50 total points
ID: 12214847
Hi yuvarani ,

1) I got these warning in VC7. Why these warning do not seen  in VC6? Is Ordinal numbers are mandatory in VC6 ?
A) I think its a kind of enhancement in VC7.

2) Is there any scenario where using ordinal numbers are advantageous?
A) If you are not using the __declspec(dllexport) keyword to export the DLL's functions, the DLL
requires a .DEF file and in this def files we use Ordinal Numbers

3) There's another warning also in my initial post:  "LINK : warning LNK4089: all references to 'SHELL32.dll' discarded by /OPT:REF"
A) The linker discarded all packaged functions that referenced exports in dynamic-link library. As a result, dynamic-link library is not needed for execution of the image.
You may want to consider removing references to dynamic-link library to speed up the build.
Other occurrences of this warning can occur if an unused function in your code references a .dll export that the linker has discarded. Use /VERBOSE to see which of your functions the linker is discarding and then remove them from your code.


Please refer following link to get good understanding of export using DLL -
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_export_from_a_dll.asp

Regards,
Santino
0
 
LVL 3

Expert Comment

by:Santino_k
ID: 12214864
To add to what i said above -
Every COM DLL requires following functions to be exported -
'DllCanUnloadNow'
'DllGetClassObject'
'DllRegisterServer'
'DllUnregisterServer'

Thus ordinal positions for these functions are ignored in VC7
0
 

Author Comment

by:yuvarani
ID: 12215576
hi Santino,
 Thanks for your info.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
A short article about a problem I had getting the GPS LocationListener working.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now