Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

com dll vc6 to vc7: Can we ignore  these warnings

Posted on 2004-09-30
5
Medium Priority
?
1,280 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 150 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Six Sigma Control Plans
Introduction to Processes

972 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