Click here to Skip to main content
15,919,028 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: Merging managed extensions C++ to my existing application Pin
BAIJUMAX16-Sep-04 1:25
professionalBAIJUMAX16-Sep-04 1:25 
Generalpass data to vb6 dll Pin
NikoTanghe15-Sep-04 5:58
NikoTanghe15-Sep-04 5:58 
GeneralActiveX problem Pin
archetype14-Sep-04 1:34
archetype14-Sep-04 1:34 
GeneralLOGFONT structure Pin
AnsGe13-Sep-04 19:36
AnsGe13-Sep-04 19:36 
GeneralRe: LOGFONT structure Pin
ursus zeta15-Sep-04 13:37
ursus zeta15-Sep-04 13:37 
GeneralRe: LOGFONT structure Pin
AnsGe15-Sep-04 18:46
AnsGe15-Sep-04 18:46 
GeneralRe: LOGFONT structure Pin
george ivanov21-Sep-04 2:21
george ivanov21-Sep-04 2:21 
GeneralRe: LOGFONT structure Pin
ursus zeta21-Sep-04 14:11
ursus zeta21-Sep-04 14:11 
I came across this over at the MSDN site:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vcwlkPlatformInvokeTutorial.asp[^]
It's written for C# programmers, but, you use the same attribute in C++.
Also, if you just want to set only the Font height, and leave all the other LOGFONT structure members in their default settings (except for the Face Name), you can just use the appropriate Font constructor from the .NET Framework class library (without calling the FromLogfont method). This is the simplest approach. You instantiate with the new operator, the same way you do for all Form controls.
It occurred to me that the GDI LOGFONT structure is unmanaged code, and the Interop Marshaler makes the data conversions from managed to unmanaged and back again (if necessary). The problem with the LOGFONT struct, is that the original definition takes the lfFaceName mamber as an array of type TCHAR. Since this could be either ANSI or Unicode, the size of the array is not known at compile time. I assume the Interop Marshaler does not convert these values correctly (and, you'd think they'd note that in the documentation for the FromLogfont method). And, so you must specify this explicitly with the MarshalAs pseudo-custom attribute.
There are lengthy explanations of the inner workings of Interop marshaling in Adam Nathan's book, ".NET and COM: The Complete Interoperability Guide".
GeneralNewbie: Passing an object to a class Pin
jblau13-Sep-04 13:36
jblau13-Sep-04 13:36 
GeneralRe: Newbie: Passing an object to a class Pin
AnsGe13-Sep-04 19:59
AnsGe13-Sep-04 19:59 
GeneralRe: Newbie: Passing an object to a class Pin
jblau14-Sep-04 3:10
jblau14-Sep-04 3:10 
GeneralNew Games Company Requires Programers Pin
KingsZone13-Sep-04 8:34
sussKingsZone13-Sep-04 8:34 
GeneralRe: New Games Company Requires Programers Pin
Christian Graus15-Sep-04 14:24
protectorChristian Graus15-Sep-04 14:24 
GeneralRe: New Games Company Requires Programers Pin
mayowa16-Sep-04 21:10
mayowa16-Sep-04 21:10 
GeneralNewbie: Create Events and EventHandlers Pin
jblau12-Sep-04 11:01
jblau12-Sep-04 11:01 
GeneralRe: Newbie: Create Events and EventHandlers Pin
Christian Graus15-Sep-04 15:11
protectorChristian Graus15-Sep-04 15:11 
GeneralReading file from OpenFileDialog. Pin
Link260010-Sep-04 13:05
Link260010-Sep-04 13:05 
GeneralRe: Reading file from OpenFileDialog. Pin
AnsGe14-Sep-04 4:44
AnsGe14-Sep-04 4:44 
Generalwondering for some help Pin
Anonymous10-Sep-04 4:26
Anonymous10-Sep-04 4:26 
GeneralRe: wondering for some help Pin
Christian Graus15-Sep-04 14:35
protectorChristian Graus15-Sep-04 14:35 
GeneralC# to managed C++ Pin
sreejith ss nair9-Sep-04 22:50
sreejith ss nair9-Sep-04 22:50 
GeneralRe: C# to managed C++ Pin
BAIJUMAX9-Sep-04 23:54
professionalBAIJUMAX9-Sep-04 23:54 
Generalaccess control in a derived class Pin
void()9-Sep-04 13:33
void()9-Sep-04 13:33 
GeneralAn unhandled exception has occurred in your application Pin
Waleed Eissa9-Sep-04 9:46
Waleed Eissa9-Sep-04 9:46 
Generalhelp!!!!! fork program Pin
nivsah7-Sep-04 14:33
nivsah7-Sep-04 14:33 

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.