esskar / Canon.Eos.Framework

Currently, this project is not under development. Time is not my friend.
MIT License
66 stars 33 forks source link

anybody have a problem when use Canon.Eos.Framework in windows 7 #16

Open soar-penguin opened 12 years ago

soar-penguin commented 12 years ago

we development a software control two cameras use Canon.Eos.Framework. when we run it in windows xp, it's ok, but when run it in windows 7, start it is OK. it can start liveView mode when in open the software. but when i hit the button take picture or change the driver len use(EDSDK.EvfDriveLens_Far2), the software is crashed. can't continue. i test in several machine. three installed XP is OK. two installed windows 7 the same problem. any idea? thank you!

esskar commented 12 years ago

i just merged a possible bugfix from simon that may fixes your issue.

soar-penguin commented 12 years ago

the bugfix not suitable for me. I had fix it before you merged this issue. my problem may be just because the EDSDK.dll. when i debug the program, the problem happened when the program call the api the dll provide. just like the EdsSendCommand and so on. the program is crashed, can't continue.

soar-penguin commented 12 years ago

@esskar could you tell me why those function must change the "CallingConvention"? thank you!

    [DllImport("EDSDK.dll", EntryPoint="EdsCreateEvfImageRef", CallingConvention=CallingConvention.Cdecl)]        
public extern static uint EdsCreateEvfImageRefCdecl(IntPtr inStreamRef, out IntPtr outEvfImageRef);

    [DllImport("EDSDK.dll", EntryPoint="EdsDownloadEvfImage", CallingConvention=CallingConvention.Cdecl)]
    public extern static uint EdsDownloadEvfImageCdecl(IntPtr inCameraRef, IntPtr outEvfImageRef); 
simonbuehler commented 11 years ago

@soar-penguin its has to be compiled for x86 not i64, changing the signature to Unit32 and removing the CallingConvention=CallingConvention.Cdecl should help