Click here to Skip to main content
15,923,051 members
Home / Discussions / C#
   

C#

 
AnswerRe: Hide "sender" of a mail c# Pin
Christian Graus30-Jun-08 10:40
protectorChristian Graus30-Jun-08 10:40 
GeneralRe: Hide "sender" of a mail c# Pin
Bert delaVega30-Jun-08 11:17
Bert delaVega30-Jun-08 11:17 
AnswerRe: Hide "sender" of a mail c# Pin
Guffa30-Jun-08 12:38
Guffa30-Jun-08 12:38 
GeneralRe: Hide "sender" of a mail c# Pin
Member 431105730-Jun-08 22:49
Member 431105730-Jun-08 22:49 
QuestionNewbie Question - Displaying Data Pin
kruegersck30-Jun-08 10:22
kruegersck30-Jun-08 10:22 
AnswerRe: Newbie Question - Displaying Data Pin
paas30-Jun-08 10:39
paas30-Jun-08 10:39 
AnswerRe: Newbie Question - Displaying Data Pin
Christian Graus30-Jun-08 10:41
protectorChristian Graus30-Jun-08 10:41 
QuestionP/Invoke Problem (can't find the .dll) Pin
oscarderooij30-Jun-08 10:03
oscarderooij30-Jun-08 10:03 
First of all let me apologize for posting this without searching about it first.
I'm doing this because I'm in a hurry and I need to leave my work right now, and I was in the middle of this problem.

Well I'm starting on p/invoke just now and I can't make it work.
I created a class with all methods I need to call from the dll and it looks something like this:
[DllImport(@"MitraLib.dll", EntryPoint = "MitraConectaBD", CallingConvention = CallingConvention.StdCall)]
  public static extern int MitraConectaBD(IntPtr AsUsuario, IntPtr AsSenha, IntPtr AsBanco, bool AbLoginPrompt);


Well, with the class created I started to code what I wanted:
public Form1()
  {
      Thread.CurrentThread.Name = "MAIN";

      InitializeComponent();

      IntPtr ptrLogin = Marshal.StringToHGlobalAnsi("oscar");

      IntPtr ptrSenha = Marshal.StringToHGlobalAnsi("1");

      IntPtr ptrDataBase = Marshal.StringToHGlobalAnsi("Gerencial2000i");

      int retCode = MitraLib.MitraConectaBD(ptrLogin, ptrSenha, ptrDataBase, false); //Exception!

      Marshal.FreeHGlobal(ptrLogin);
      Marshal.FreeHGlobal(ptrSenha);
      Marshal.FreeHGlobal(ptrDataBase);
  }


Well, when I try to compile my project I get an exception saying
(translated to english by myself)
It wasn't possible to load the DLL 'MitraLib.dll': It wasn't possible to find the specific module(Exception HRESULT: 0x8007007E)

or something like that.

Does anyone have any clue?
I'm sorry again for posting this withou searching the forum (although I googled it but didn't find anything)

ps. MitraLib.dll is a Delphi code.

Thanks in advance
Oscar
AnswerRe: P/Invoke Problem (can't find the .dll) Pin
PIEBALDconsult30-Jun-08 10:18
mvePIEBALDconsult30-Jun-08 10:18 
GeneralRe: P/Invoke Problem (can't find the .dll) Pin
oscarderooij1-Jul-08 2:10
oscarderooij1-Jul-08 2:10 
GeneralRe: P/Invoke Problem (can't find the .dll) Pin
oscarderooij1-Jul-08 2:22
oscarderooij1-Jul-08 2:22 
AnswerRe: P/Invoke Problem (can't find the .dll) Pin
Kythen30-Jun-08 10:30
Kythen30-Jun-08 10:30 
GeneralRe: P/Invoke Problem (can't find the .dll) Pin
oscarderooij1-Jul-08 2:29
oscarderooij1-Jul-08 2:29 
AnswerRe: P/Invoke Problem (can't find the .dll) Pin
Luc Pattyn30-Jun-08 10:37
sitebuilderLuc Pattyn30-Jun-08 10:37 
GeneralRe: P/Invoke Problem (can't find the .dll) Pin
oscarderooij1-Jul-08 2:34
oscarderooij1-Jul-08 2:34 
GeneralRe: P/Invoke Problem (can't find the .dll) Pin
Luc Pattyn1-Jul-08 3:32
sitebuilderLuc Pattyn1-Jul-08 3:32 
GeneralRe: P/Invoke Problem (can't find the .dll) Pin
oscarderooij1-Jul-08 3:52
oscarderooij1-Jul-08 3:52 
GeneralRe: P/Invoke Problem (can't find the .dll) Pin
Luc Pattyn1-Jul-08 4:00
sitebuilderLuc Pattyn1-Jul-08 4:00 
Questionprinting Pin
netJP12L30-Jun-08 9:39
netJP12L30-Jun-08 9:39 
AnswerRe: printing Pin
Christian Graus30-Jun-08 10:51
protectorChristian Graus30-Jun-08 10:51 
QuestionPropertyGrid - Emulate event TypeEditor for a non-event custom type. Pin
Marlboro230-Jun-08 9:27
Marlboro230-Jun-08 9:27 
AnswerRe: PropertyGrid - Emulate event TypeEditor for a non-event custom type. Pin
Judah Gabriel Himango30-Jun-08 9:41
sponsorJudah Gabriel Himango30-Jun-08 9:41 
GeneralRe: PropertyGrid - Emulate event TypeEditor for a non-event custom type. Pin
Marlboro230-Jun-08 10:02
Marlboro230-Jun-08 10:02 
GeneralRe: PropertyGrid - Emulate event TypeEditor for a non-event custom type. Pin
Judah Gabriel Himango30-Jun-08 10:07
sponsorJudah Gabriel Himango30-Jun-08 10:07 
GeneralRe: PropertyGrid - Emulate event TypeEditor for a non-event custom type. Pin
Marlboro230-Jun-08 11:02
Marlboro230-Jun-08 11:02 

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.