Solved

com dll vc6 to vc7: Can we ignore  these warnings

Posted on 2004-09-30
5
1,241 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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.
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.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

730 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