Click here to Skip to main content
15,888,802 members
Home / Discussions / C#
   

C#

 
GeneralReturning string from unmanaged dll Pin
Mikke_x10-May-04 23:50
Mikke_x10-May-04 23:50 
GeneralRe: Returning string from unmanaged dll Pin
Heath Stewart11-May-04 3:31
protectorHeath Stewart11-May-04 3:31 
GeneralRe: Returning string from unmanaged dll Pin
Mikke_x11-May-04 4:06
Mikke_x11-May-04 4:06 
GeneralRe: Returning string from unmanaged dll Pin
Heath Stewart11-May-04 4:59
protectorHeath Stewart11-May-04 4:59 
GeneralRe: Returning string from unmanaged dll Pin
Mikke_x11-May-04 5:02
Mikke_x11-May-04 5:02 
GeneralRe: Returning string from unmanaged dll Pin
Heath Stewart11-May-04 5:20
protectorHeath Stewart11-May-04 5:20 
QuestionFont to LOGFONT ? Pin
azusakt10-May-04 23:06
azusakt10-May-04 23:06 
AnswerRe: Font to LOGFONT ? Pin
Kannan Kalyanaraman10-May-04 23:22
Kannan Kalyanaraman10-May-04 23:22 
azusakt wrote:
can I directly create a cFont from LOGFONT in C++?

CreateFontIndirect would be the method for that, its a member of CFont.

azusakt wrote:
How can I convert C# Font to LOGFONT ? I know we can use Font.ToLogFont(), but I don't know how to use this function.

There could be other ways, but you can declare a structure similar to the LOGFONT in c# and then fill in this structure with the values from Font object and pass this structure to your C++ library. You need to go through P/Invoke to achieve this.
Your LOGFONT structure in C# would look like this,

[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
public class LOGFONT
{
public int lfHeight;
public int lfWidth;
public int lfEscapement;
public int lfOrientation;
public int lfWeight;
public byte lfItalic;
public byte lfUnderline;
public byte lfStrikeOut;
public byte lfCharSet;
public byte lfOutPrecision;
public byte lfClipPrecision;
public byte lfQuality;
public byte lfPitchAndFamily;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=32)]
public string lfFaceName;
}
Update :
You'd need to create an object of tihs type and then call ToLogFont function.

Hope this helps.
GeneralRe: Font to LOGFONT ? Pin
Heath Stewart11-May-04 3:40
protectorHeath Stewart11-May-04 3:40 
GeneralRe: Font to LOGFONT ? Pin
azusakt11-May-04 16:55
azusakt11-May-04 16:55 
GeneralRe: Font to LOGFONT ? Pin
Heath Stewart12-May-04 2:45
protectorHeath Stewart12-May-04 2:45 
GeneralRe: Font to LOGFONT ? Pin
azusakt11-May-04 22:41
azusakt11-May-04 22:41 
GeneralRe: Font to LOGFONT ? Pin
azusakt12-May-04 15:20
azusakt12-May-04 15:20 
GeneralSockets Pin
bouli10-May-04 22:58
bouli10-May-04 22:58 
GeneralRe: Sockets Pin
Heath Stewart11-May-04 3:44
protectorHeath Stewart11-May-04 3:44 
GeneralQuartz.dll Pin
MeterMan10-May-04 22:51
MeterMan10-May-04 22:51 
GeneralRe: Quartz.dll Pin
Heath Stewart11-May-04 3:46
protectorHeath Stewart11-May-04 3:46 
GeneralString question Pin
pankajdaga10-May-04 22:26
pankajdaga10-May-04 22:26 
GeneralRe: String question Pin
Kannan Kalyanaraman10-May-04 23:07
Kannan Kalyanaraman10-May-04 23:07 
Generalthanks! Pin
pankajdaga10-May-04 23:22
pankajdaga10-May-04 23:22 
GeneralGet The Time When The Program Execute Pin
DucLinh10-May-04 21:27
DucLinh10-May-04 21:27 
GeneralRe: Get The Time When The Program Execute Pin
Mazdak10-May-04 21:41
Mazdak10-May-04 21:41 
GeneralRe: Get The Time When The Program Execute Pin
DucLinh10-May-04 22:09
DucLinh10-May-04 22:09 
GeneralRe: Get The Time When The Program Execute Pin
Heath Stewart11-May-04 3:16
protectorHeath Stewart11-May-04 3:16 
Generalpopup a dialog when change drop down list selection Pin
davidlyy10-May-04 17:29
davidlyy10-May-04 17:29 

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.