תשובה unable to register com dll

  • יום חמישי 08 מרץ 2012 07:14
     
     

    I'm creating a com dll, managed to compile it but got error while registering(Regsvr32) it. When goggling around, it state to load the dll into dependency walker to found out the errors. I did so, and it appears there are other dlls missing in my system. They are API-MS-WIN-CORE-PROCESSTHREADS-L1-1-0.DLL, and API-MS-WIN-SECURITY-BASE-L1-1-0.DLL. These dlls are for win7 and i 'm using xp compiling with VS 2005. Furthermore, these dlls are not downloadable. is it possible to go round it?

כל התגובות

  • יום חמישי 08 מרץ 2012 07:33
     
     תשובה

    Whenever you call a system function, you must check MSDN to see if it's supported by the system you want to run your code on. Looks like it's not the case on XP, with whatever functions you use from these DLLs. If that happens, the normal way is to modify to dynamically load functions only on systems that do have it. You use LoadLibrary to load the DLL and GetProcAddress to get function pointer. On systems that do not support "your" functions, well, you need to drop your functionality, or find another way.

    Sometimes, it's possible to deploy an additional DLL on another system, by yourself. I doubt that's the case here.

    Goran.

    P.S. I am talking about functions, because it happens that a system DLL is there, but function you need is present in it only starting with some system version or a service release.

  • יום שני 12 מרץ 2012 03:40
     
     

    I agree with Goran. you should make sure that all the APIs you used in the appliction are supported by the OS which the application is running on.

    please try runnning the application in Windows 7 system to see if you still have errors of this kind.


    Please mark this reply as answer if it helps you! Thanks for your cooperation! Good Luck to you.

  • יום שני 12 מרץ 2012 03:49
     
     

    If you want to target XP, make sure your source code defines:

    #define _WIN32_WINNT 0x0501

    I suggest placing this in your stdafx.h header file.

    Read more about this here.