Import a "C" function that returns a struct...

S

Sam

I have a .dll with "C" functions that I need to call. One of the
functions returns a simple struct(2 doubles)

If I try to use DllImport like this:

[ DllImport("somedll.dll]
SomeStruct1 f1(SomeStruct1 *pS);

I get compiler error C3385 "a function that has a DllImport Custom
Attribute cannot return an instance of a class"

How can I import a function from a DLL that returns a struct???

Thanks a ton,
Sam
 
G

Guest

我英语ä¸æ˜¯å¾ˆå¥½ï¼Œæ‰€ä»¥çœ‹ä½ ä»¬çš„贴很åƒåŠ›ï¼Œæ‰€ä»¥æˆ‘无法用E语回答
我以å‰æ˜¯delphi程åºå‘˜ï¼Œå¯¹å®ƒä¹Ÿä¸æ˜¯ç ”究得特别的深,我但一直很喜欢VC,我在国内的论å›æ问,很有人跟我讲解,所以我一气之下跑到这里æ¥æ,ä¸ç®¡è¯­è¨€çš„问题,åªè¦æœ‰äººè·Ÿæˆ‘解答,我都会好好体会和学习的
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top