Click here to Skip to main content
16,015,900 members
Home / Discussions / C#
   

C#

 
Questionusing DLL in Vista 64bit, Bad Image Format Exception Pin
sharp_k8-May-08 5:32
sharp_k8-May-08 5:32 
AnswerRe: using DLL in Vista 64bit, Bad Image Format Exception Pin
Judah Gabriel Himango8-May-08 7:42
sponsorJudah Gabriel Himango8-May-08 7:42 
GeneralRe: using DLL in Vista 64bit, Bad Image Format Exception Pin
sharp_k8-May-08 14:44
sharp_k8-May-08 14:44 
GeneralRe: using DLL in Vista 64bit, Bad Image Format Exception Pin
Judah Gabriel Himango9-May-08 4:51
sponsorJudah Gabriel Himango9-May-08 4:51 
GeneralRe: using DLL in Vista 64bit, Bad Image Format Exception Pin
sharp_k9-May-08 5:34
sharp_k9-May-08 5:34 
GeneralRe: using DLL in Vista 64bit, Bad Image Format Exception Pin
Judah Gabriel Himango9-May-08 5:47
sponsorJudah Gabriel Himango9-May-08 5:47 
GeneralRe: using DLL in Vista 64bit, Bad Image Format Exception Pin
sharp_k9-May-08 6:56
sharp_k9-May-08 6:56 
GeneralRe: using DLL in Vista 64bit, Bad Image Format Exception Pin
Judah Gabriel Himango9-May-08 8:36
sponsorJudah Gabriel Himango9-May-08 8:36 
Yep, that looks problematic: the first value is an integer. In .NET, this will always be 4 bytes. In native code, however, this will be either 4 bytes on a 32-bit system, or 8 bytes on a 64 bit system (IIRC). Instead of an integer, pass in an IntPtr. Your function would look something like this:

[DllImport(dllName, ExactSpelling=true, SetLastError=false, CallingConvention=CallingConvention.Cdecl)]
       internal static extern float a_function(IntPtr n, [In] float[] x, IntPtr incX);
<br />



Tech, life, family, faith: Give me a visit.
From my latest post: "It's sobering to watch: the whole country stops for 2 minutes as a siren is blast to remember the 22,437 victims of terror and soldiers who died in defense of Israel..."
The apostle Paul, modernly speaking: Epistles of Paul

Judah Himango


GeneralRe: using DLL in Vista 64bit, Bad Image Format Exception Pin
sharp_k9-May-08 10:18
sharp_k9-May-08 10:18 
QuestionArrayList worked unexpectedly... Pin
natsuyaki8-May-08 4:39
natsuyaki8-May-08 4:39 
AnswerRe: ArrayList worked unexpectedly... Pin
Anthony Mushrow8-May-08 6:13
professionalAnthony Mushrow8-May-08 6:13 
AnswerRe: ArrayList worked unexpectedly... Pin
Luc Pattyn8-May-08 6:25
sitebuilderLuc Pattyn8-May-08 6:25 
AnswerRe: ArrayList worked unexpectedly... Pin
Gareth H8-May-08 7:46
Gareth H8-May-08 7:46 
AnswerRe: ArrayList worked unexpectedly... Pin
GuyThiebaut8-May-08 8:01
professionalGuyThiebaut8-May-08 8:01 
GeneralRe: ArrayList worked unexpectedly... Pin
Guffa8-May-08 10:49
Guffa8-May-08 10:49 
GeneralRe: ArrayList worked unexpectedly... Pin
natsuyaki10-May-08 21:24
natsuyaki10-May-08 21:24 
QuestionProgramaticly stop & start sql server? Pin
Harvey Saayman8-May-08 4:33
Harvey Saayman8-May-08 4:33 
AnswerRe: Programaticly stop & start sql server? Pin
N a v a n e e t h8-May-08 4:52
N a v a n e e t h8-May-08 4:52 
GeneralRe: Programaticly stop & start sql server? Pin
Harvey Saayman8-May-08 4:53
Harvey Saayman8-May-08 4:53 
AnswerRe: Programaticly stop & start sql server? Pin
Jimmanuel8-May-08 4:56
Jimmanuel8-May-08 4:56 
GeneralRe: Programaticly stop & start sql server? Pin
Harvey Saayman9-May-08 1:21
Harvey Saayman9-May-08 1:21 
QuestionTo the whole commuity(Part of my code) Pin
Oluwayomi8-May-08 3:58
Oluwayomi8-May-08 3:58 
AnswerCP Members Please Ignore : Duplicate Post Pin
Abhijit Jana8-May-08 4:14
professionalAbhijit Jana8-May-08 4:14 
AnswerRe: To the whole commuity(Part of my code) Pin
J4amieC8-May-08 4:46
J4amieC8-May-08 4:46 
AnswerRe: To the whole commuity(Part of my code) Pin
Dave Kreskowiak8-May-08 5:24
mveDave Kreskowiak8-May-08 5:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.