Click here to Skip to main content
15,919,423 members
Home / Discussions / C#
   

C#

 
AnswerRe: 3 state Button - weird behaviour [modified] Pin
Ilíon4-Oct-06 9:59
Ilíon4-Oct-06 9:59 
Questionfile system watcher problem Pin
gus_br4-Oct-06 8:39
gus_br4-Oct-06 8:39 
AnswerRe: file system watcher problem Pin
Andrew Rissing4-Oct-06 11:42
Andrew Rissing4-Oct-06 11:42 
GeneralRe: file system watcher problem Pin
gus_br4-Oct-06 14:04
gus_br4-Oct-06 14:04 
GeneralRe: file system watcher problem Pin
Andrew Rissing5-Oct-06 4:27
Andrew Rissing5-Oct-06 4:27 
GeneralRe: file system watcher problem Pin
gus_br6-Oct-06 7:03
gus_br6-Oct-06 7:03 
AnswerRe: file system watcher problem Pin
Andrew Rissing6-Oct-06 7:25
Andrew Rissing6-Oct-06 7:25 
QuestionDllImport / PInvoke Problem? Pin
David Knechtges4-Oct-06 8:18
David Knechtges4-Oct-06 8:18 
I am having a strange problem that I have been unable to solve.

Basically, I am doing a DllImport on an unmanaged DLL that I have written, called "config.dll". This DLL is a bunch of C code compiled under a project in VS2005. This is all in a seperate solution.

When I place the DllImport into my C# project, it works fine as long as the config.dll is located in a different folder than the one the C# project is running from (and the DLLImport statement points to the other folder). I have also tried hardcoding the path of the DllImport statement to the directory of the C# project, either through "c:\\test\\config.dll" or ".\\config.dll", and these both give the same result as just "config.dll".

My failing DllImport:

[DllImport("config.dll", CallingConvention=CallingConvention.Cdecl)]

My working DllImport:

[DllImport("c:\\otherdir\\config.dll", CallingConvention=CallingConvention.Cdecl)]

The exception I get is (xxx.dll is the c# project):

An unhandled exception of type 'System.BadImageFormatException' occurred in xxx.dll

Additional information: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)


Any help or things for me to check would be appreciated!

Thanks,

David
AnswerRe: DllImport / PInvoke Problem? Pin
Ed.Poore4-Oct-06 11:11
Ed.Poore4-Oct-06 11:11 
GeneralRe: DllImport / PInvoke Problem? Pin
David Knechtges5-Oct-06 7:32
David Knechtges5-Oct-06 7:32 
QuestionGTK# deployment - an installer project. Pin
P85Dyer4-Oct-06 7:47
P85Dyer4-Oct-06 7:47 
QuestionGrouping Array of Objects by Properties Pin
tntomek4-Oct-06 7:14
tntomek4-Oct-06 7:14 
AnswerRe: Grouping Array of Objects by Properties Pin
LongRange.Shooter4-Oct-06 7:17
LongRange.Shooter4-Oct-06 7:17 
GeneralRe: Grouping Array of Objects by Properties Pin
tntomek4-Oct-06 7:38
tntomek4-Oct-06 7:38 
AnswerRe: Grouping Array of Objects by Properties Pin
Nicholas Butler4-Oct-06 8:45
sitebuilderNicholas Butler4-Oct-06 8:45 
GeneralRe: Grouping Array of Objects by Properties Pin
LongRange.Shooter4-Oct-06 14:29
LongRange.Shooter4-Oct-06 14:29 
QuestionSorting a listview from an array. Pin
teejayem4-Oct-06 6:10
teejayem4-Oct-06 6:10 
AnswerRe: Sorting a listview from an array. Pin
aamironline4-Oct-06 6:38
aamironline4-Oct-06 6:38 
AnswerRe: Sorting a listview from an array. Pin
Eric Dahlvang4-Oct-06 6:39
Eric Dahlvang4-Oct-06 6:39 
QuestionHow to get two child classes to access a third class Pin
Muntyness4-Oct-06 5:12
Muntyness4-Oct-06 5:12 
AnswerRe: How to get two child classes to access a third class Pin
Le centriste4-Oct-06 5:22
Le centriste4-Oct-06 5:22 
AnswerRe: How to get two child classes to access a third class Pin
led mike4-Oct-06 5:22
led mike4-Oct-06 5:22 
AnswerRe: How to get two child classes to access a third class Pin
aamironline4-Oct-06 5:23
aamironline4-Oct-06 5:23 
AnswerRe: How to get two child classes to access a third class Pin
Muntyness4-Oct-06 5:39
Muntyness4-Oct-06 5:39 
GeneralRe: How to get two child classes to access a third class Pin
aamironline4-Oct-06 6:00
aamironline4-Oct-06 6:00 

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.