views:

88

answers:

1

Hello everybody let me give you the background first: I'm working on a project that is build with vs2005 on a winxp sp3 with the windows sdk 7.0 and most important the hotfix, that is targeted to work from win xp (sp 0) -> windows 7.

part of the project is querying the snapshots and play with the a bit. On my development environment everything is ok, on windows 7 everything is ok (Kinda ok but it's not the point).

On clean xp machines (sp3 & 2) I get: "The procedure entry point CreateVssBackupComponentsInternal could not be located in the dynamic link library VSSAPI.DLL" when I start the application - Even before I get to the part in the code that is related to the VSSAPI...

1) how can it raise the message before I get to the invocation? 2) Does anyone has an idea why it doesn't work?

thanks

+2  A: 

1) Because the DLL is loaded when your application starts, not when it's first needed. Look up delay-loading or the LoadLibrary system call if you want to load it later, or even conditionally.

2) I don't know, but someone asked the same question before: http://stackoverflow.com/questions/789754/why-does-my-volume-shadow-copy-service-requester-fail-cannot-find-createvssbacku

torhu
Thanks for your answer, I've seen that post and I thought that because my function invocation was not called that my issue is different.I hope my next Question wont be too much, to dynamically call the CreateBackupVssComponent is easy, but the rest of the functions (which are members function of classes that are members of the vss family) will be a bit harder.Is it the call to CreateBackupVssComponent function that makes the application verify if it exists in the DLL? In other words if I wont call the function at all will it search for it in the DLL?
ManicQin
If there's a call to the function in your app, the DLL will be loaded at startup, and the function needs to be in it. You can't do it conditionally without using LoadLibrary and GetProcAddress.
torhu
mmm... Thanks.I'll try loading them dynamically.I discovered that some of the libraries in my project throw a message of "WINVER not defined. Defaulting to 0x0502 (Windows Server 2003)" probably this is the problem.thanks!
ManicQin
Hey Still no luck.I look into the file VSbackup.h and the function CreateVSSBackComponenets is defined:inline HRESULT CreateVssBackupComponents ( __out IVssBackupComponents **ppBackup ){ return CreateVssBackupComponentsInternal(ppBackup);}It doesn't matter what is the OS version.
ManicQin