Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / March 2005

Tip: Looking for answers? Try searching our database.

Getting structs from gdi32

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peder Y - 25 Mar 2005 14:32 GMT
Hi!

[partly a cross-post with win32.gdi, but noone answers questions there]

I'm working on a C# project where we need to get glyph vertices from
fonts. There are several examples on how to do this in C++, but interop
not being my strongest side, I have some questions:

1) Most gdi functions use structs defined elsewhere, e.g. in gdi32. Do I
need to redeclare those structs or can they be imported using some
directive or extern or something?

2) They also use types as DWORD and such. Other solutions say "just use
int", but is this really the proper way to do it? Can we get hold of
these types programatically?

Thanks!

- Peder -
Mattias Sj?gren - 25 Mar 2005 17:23 GMT
Peder,

>1) Most gdi functions use structs defined elsewhere, e.g. in gdi32. Do I
>need to redeclare those structs or can they be imported using some
>directive or extern or something?

Yes they must be declared in managed code. To save some work you can
look for existing declarations at http://www.pinvoke.net.

>2) They also use types as DWORD and such. Other solutions say "just use
>int", but is this really the proper way to do it?

Yes, although uint may be more appropriate if the full value range is
used.

Mattias

Signature

Mattias Sjögren [MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Peder Y - 25 Mar 2005 20:35 GMT
Thanks Mattias!

pinvoke.net also automagically solved another question I posted earlier,
so I guess I can happily go for a well-deserved Friday beer now.

- Peder -

Mattias Sjögren wrote:
> Peder,
>
[quoted text clipped - 12 lines]
>
> Mattias

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.