मैं कोड निम्नलिखित है [PInvoke कार्य करने के लिए एक कॉल स्टैक असंतुलित], एक बार मैं अपने एप्लिकेशन को चलाने मैं इस त्रुटित्रुटि फ़ंक्शन कॉल,
किसी को पता पाने के मैं कैसे इस त्रुटि को ठीक?
त्रुटि:
PInvoke कार्य करने के लिए एक कॉल 'testcamera EDSDKLib.EDSDK :: EdsDownloadEvfImage!' असंतुलित ढेर है। ऐसा संभव है क्योंकि प्रबंधित PInvoke हस्ताक्षर अप्रबंधित लक्ष्य हस्ताक्षर से मेल नहीं खाता है। जाँच करें कि बुला सम्मेलन और PInvoke हस्ताक्षर के मापदंडों लक्ष्य अप्रबंधित हस्ताक्षर
IntPtr cameraDev;
bool LVrunning = false;
uint err = EDSDK.EDS_ERR_OK;
uint device = 0;
IntPtr MemStreamRef = new IntPtr(0);
IntPtr EvfImageRef = new IntPtr(0);
PictureBox pbLV;
public LiveView(IntPtr c, PictureBox p)
{
cameraDev = c;
pbLV = p;
}
internal void StartLiveView()
{
//LVrunning = true;
//int i = 0;
// Get the output device for the live view image
err = EDSDK.EdsGetPropertyData(cameraDev, EDSDK.PropID_Evf_OutputDevice, 0, out device);
Debug.WriteLineIf(err != EDSDK.EDS_ERR_OK, String.Format("Get Property Data failed: {0:X}", err));
Debug.WriteLineIf(err == EDSDK.EDS_ERR_OK, String.Format("Liveview output is: {0:x}", device));
Thread.Sleep(1000);
// Set the computer as live view destination
if (err == EDSDK.EDS_ERR_OK)
{
err = EDSDK.EdsSetPropertyData(cameraDev, EDSDK.PropID_Evf_OutputDevice, 0,
Marshal.SizeOf(EDSDK.EvfOutputDevice_PC), EDSDK.EvfOutputDevice_PC);
Debug.WriteLine(String.Format("Liveview output to computer: {0:X}", err));
}
// Create a memory stream for the picture
if (err == EDSDK.EDS_ERR_OK)
{
err = EDSDK.EdsCreateMemoryStream(0, out MemStreamRef);
Debug.WriteLine(String.Format("Create Memory Stream: {0:X}", err));
}
// Get a reference to a EvfImage
if (err == EDSDK.EDS_ERR_OK)
{
**//i get error here**
**err = EDSDK.EdsCreateEvfImageRef(MemStreamRef, out EvfImageRef);**
Debug.WriteLine(String.Format("Create Evf Imaage Ref: {0:X}", err));
}
Thread.Sleep(2000);
}
से मेल
अधिक जानकारी -dllimport प्रदान करें, EdsDownloadEvfImage हस्ताक्षर – tom3k
यह मेरा dllimport, [DllImport ("EDSDK.dll")] सार्वजनिक निर्वासन स्थिर uint EdsCreateEvfImageRef (IntPtr inStreamRef, बाहर IntPtr outEvfImageRef) है; – user1400
और मूल हस्ताक्षर कार्य क्या है? – tom3k