Solved

com dll vc6 to vc7: Can we ignore  these warnings

Posted on 2004-09-30
5
1,207 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Visual xHarbour 1 76
Python Encoding Problem \u2013 4 86
strCopies  challenge 17 73
Re-position sub-options beneath the TAB 7 42
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

758 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

17 Experts available now in Live!

Get 1:1 Help Now