Click here to Skip to main content
15,902,276 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questioninitialization text on dialog box Pin
Shah Satish22-Jan-07 6:37
Shah Satish22-Jan-07 6:37 
AnswerRe: initialization text on dialog box Pin
toxcct22-Jan-07 7:09
toxcct22-Jan-07 7:09 
GeneralRe: initialization text on dialog box Pin
Shah Satish22-Jan-07 21:55
Shah Satish22-Jan-07 21:55 
AnswerRe: initialization text on dialog box Pin
Hamid_RT22-Jan-07 17:46
Hamid_RT22-Jan-07 17:46 
GeneralRe: initialization text on dialog box Pin
Shah Satish22-Jan-07 21:57
Shah Satish22-Jan-07 21:57 
AnswerRe: initialization text on dialog box Pin
ThatsAlok22-Jan-07 19:05
ThatsAlok22-Jan-07 19:05 
GeneralRe: initialization text on dialog box Pin
Shah Satish22-Jan-07 21:58
Shah Satish22-Jan-07 21:58 
QuestionPassing an array of structs from c# to unmanaged c++ dll Pin
Marek Konieczny22-Jan-07 6:29
Marek Konieczny22-Jan-07 6:29 
Hi,

I need to pass a relativly complicated struct into a dll calling a CORBA Service which has to be written in vc6.0 and it has to contain many elements which are necessary to create an input for a service.

Unfortunately I can see only the first array element, other are ignored.

Here an example of c# code:

<br />
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]<br />
public struct MyStrStruct3<br />
{<br />
    public string FirstName;<br />
    public string FamilyName;<br />
    public int size;<br />
}<br />
<br />
[DllImport(@"C:\Projects\CorbaLib60\Debug\CorbaLib.dll")]<br />
private static extern int TestMe(ref MyStrStruct3[] pstr);<br />
<br />
MyStrStruct3[] Names = new MyStrStruct3[2];<br />
Names[0].FamilyName = "Konieczny";<br />
Names[0].FirstName = "Marek";<br />
Names[0].size = 3;<br />
Names[1].FamilyName = "OtherName";<br />
Names[1].FirstName = "OtherFirst";<br />
Names[1].size = 2;<br />
int miki1 = TestMe(ref Names);<br />


C++ code look like this:

<br />
typedef struct _MyStruct2<br />
{<br />
   char* FirstName;<br />
   char* FamilyName;<br />
   UINT size; <br />
} MyStruct2;<br />
<br />
<br />
int TestMe(MyStruct2* pStruct[])<br />
{  <br />
int Size = 2;<br />
<br />
for (int i=0; i<Size; i++ )<br />
   {<br />
      int woofie = pStruct[i]->size;<br />
      char* miki = pStruct[i]->FamilyName;<br />
      char* miki1 = pStruct[i]->FirstName;<br />
   }<br />
   return 42;<br />
}<br />


I define export :

<br />
<br />
__declspec(dllexport) int TestMe(MyStruct2* pStruct[2]);<br />
<br />


It works, but only for first element.

Marek
AnswerRe: Passing an array of structs from c# to unmanaged c++ dll Pin
James R. Twine22-Jan-07 8:13
James R. Twine22-Jan-07 8:13 
AnswerRe: Passing an array of structs from c# to unmanaged c++ dll Pin
Tim Paaschen22-Jan-07 20:26
Tim Paaschen22-Jan-07 20:26 
QuestionDialog activex Pin
Tarek Jabri22-Jan-07 6:28
Tarek Jabri22-Jan-07 6:28 
QuestionHow do I programmatically uncheck the "Taskbar always on top" option? Pin
dandy7222-Jan-07 6:04
dandy7222-Jan-07 6:04 
AnswerRe: How do I programmatically uncheck the &quot;Taskbar always on top&quot; option? Pin
Nibu babu thomas22-Jan-07 16:21
Nibu babu thomas22-Jan-07 16:21 
GeneralRe: How do I programmatically uncheck the &quot;Taskbar always on top&quot; option? Pin
dandy7222-Jan-07 16:59
dandy7222-Jan-07 16:59 
GeneralRe: How do I programmatically uncheck the &quot;Taskbar always on top&quot; option? Pin
Nibu babu thomas22-Jan-07 17:04
Nibu babu thomas22-Jan-07 17:04 
GeneralRe: How do I programmatically uncheck the &amp;amp;quot;Taskbar always on top&amp;amp;quot; option? [modified] Pin
Nibu babu thomas22-Jan-07 17:15
Nibu babu thomas22-Jan-07 17:15 
GeneralRe: How do I programmatically uncheck the &amp;amp;quot;Taskbar always on top&amp;amp;quot; option? Pin
dandy7223-Jan-07 8:27
dandy7223-Jan-07 8:27 
GeneralRe: How do I programmatically uncheck the &amp;amp;quot;Taskbar always on top&amp;amp;quot; option? Pin
Nibu babu thomas23-Jan-07 21:07
Nibu babu thomas23-Jan-07 21:07 
GeneralRe: How do I programmatically uncheck the &amp;amp;quot;Taskbar always on top&amp;amp;quot; option? Pin
dandy7224-Jan-07 3:06
dandy7224-Jan-07 3:06 
QuestionAsk about Win32 Pin
phap22-Jan-07 5:10
phap22-Jan-07 5:10 
AnswerRe: Ask about Win32 Pin
James R. Twine22-Jan-07 5:18
James R. Twine22-Jan-07 5:18 
AnswerRe: Ask about Win32 Pin
Hamid_RT22-Jan-07 17:57
Hamid_RT22-Jan-07 17:57 
QuestionIIS DLL Pin
skerbeck22-Jan-07 4:52
skerbeck22-Jan-07 4:52 
Question"Dynamic Linking of .lib file in my project" Pin
chandni_chandrakant_maheta22-Jan-07 4:25
chandni_chandrakant_maheta22-Jan-07 4:25 
QuestionRe: "Dynamic Linking of .lib file in my project" Pin
David Crow22-Jan-07 4:31
David Crow22-Jan-07 4:31 

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.