Click here to Skip to main content
15,910,787 members
Home / Discussions / C#
   

C#

 
GeneralRe: OleDbConnection Problem... Pin
Jax_qqq26-Mar-06 21:59
Jax_qqq26-Mar-06 21:59 
QuestionShow/Hide Quick Launch Bar Pin
sherwani23-Mar-06 23:57
sherwani23-Mar-06 23:57 
AnswerRe: Show/Hide Quick Launch Bar Pin
leppie24-Mar-06 1:41
leppie24-Mar-06 1:41 
QuestionHow to load text.. Pin
AeQuitaZ23-Mar-06 23:34
AeQuitaZ23-Mar-06 23:34 
AnswerRe: How to load text.. Pin
AB777124-Mar-06 1:47
AB777124-Mar-06 1:47 
Questionbinding DataGrideView Pin
mrkeivan23-Mar-06 23:05
mrkeivan23-Mar-06 23:05 
AnswerRe: binding DataGrideView Pin
E.L. Golpe24-Mar-06 1:26
E.L. Golpe24-Mar-06 1:26 
Questioncom interop Pin
V.23-Mar-06 22:43
professionalV.23-Mar-06 22:43 
Hi,

I've already asked this before in this forum, but I still have the same problem.
I hope somebody can help me. (I've tried google and msdn)

I've wrote a wrapper for a COM module. Some parameters for the COM functions need to be passed by-value:
(long*, BSTR*, ...)

I've tried round about everything, but I always get a type mismatch error (0x80020005, DISP_E_TYPEMISMATCH)
(ref string, normal strings, with the [MarshalAsAttribute(UnmanagedType.BStr)] attribute, with unsafe keyword etc...) I also tried to change longs of the COM module to ints

here's a sample of one of the wrapped methods:
<br />
unsafe public int GetDlgText(int dlgid, int fldid, int row, int col, [MarshalAsAttribute(UnmanagedType.BStr)] string text){<br />
  int returnvalue = -1;<br />
  try{<br />
    object[] cmds = { dlgid, fldid, row, col, text };<br />
    returnvalue = Convert.ToInt32(Interaction.CallByName(idisp, "GetDlgText", CallType.Method, cmds));<br />
  } //end try<br />
  catch(Exception e) {<br />
    lasterrormessage = "Could not invoke GetDlgText function: " + e;<br />
  } //end catch<br />
  return returnvalue;<br />
} //end method GetDlgText<br />

the documentation says it's like this: long GetDlgText(long DlgId, long FldId, long Row, long Col, BSTR* Text);

What on earth could be the problem?
Tnx!!


Coulda, woulda, shoulda doesn't matter if you don't.
AnswerRe: com interop Pin
mav.northwind23-Mar-06 23:16
mav.northwind23-Mar-06 23:16 
GeneralRe: com interop Pin
V.23-Mar-06 23:30
professionalV.23-Mar-06 23:30 
Questionhow to keep track of users Pin
vamsimohan2123-Mar-06 22:15
vamsimohan2123-Mar-06 22:15 
AnswerRe: how to keep track of users Pin
CWIZO23-Mar-06 23:05
CWIZO23-Mar-06 23:05 
GeneralRe: how to keep track of users Pin
vamsimohan2123-Mar-06 23:36
vamsimohan2123-Mar-06 23:36 
QuestionInvoking JavaScript Using System.Windows.Forms.WebBrowser Pin
BapiLolly23-Mar-06 22:07
BapiLolly23-Mar-06 22:07 
QuestionUsing an ATL object in C# Pin
rasmus.toftdahl.olesen23-Mar-06 21:46
rasmus.toftdahl.olesen23-Mar-06 21:46 
QuestionInserting Shapes into Excel from Clipbord Pin
Gokulan Venattil23-Mar-06 21:36
Gokulan Venattil23-Mar-06 21:36 
QuestionTaskBar Toolbar and Shell32.dll Pin
sherwani23-Mar-06 20:34
sherwani23-Mar-06 20:34 
QuestionUsing Internet Explorer DLL file Pin
Areff23-Mar-06 20:24
Areff23-Mar-06 20:24 
AnswerRe: Using Internet Explorer DLL file Pin
oykica23-Mar-06 20:59
oykica23-Mar-06 20:59 
QuestionEnterprise Library 2006 Pin
Brendan Vogt23-Mar-06 20:01
Brendan Vogt23-Mar-06 20:01 
AnswerRe: Enterprise Library 2006 Pin
oykica23-Mar-06 20:20
oykica23-Mar-06 20:20 
GeneralRe: Enterprise Library 2006 Pin
Brendan Vogt23-Mar-06 20:46
Brendan Vogt23-Mar-06 20:46 
Questionweb part manager not working with passport 3.1 Pin
samasavinirs23-Mar-06 19:25
samasavinirs23-Mar-06 19:25 
Question[Message Deleted] Pin
Jijo BP23-Mar-06 19:10
Jijo BP23-Mar-06 19:10 
AnswerRe: Check Connection Status Pin
deepthi wilson23-Mar-06 19:18
deepthi wilson23-Mar-06 19:18 

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.