DirectX7 (DirectDraw) and C#

Posted on 2003-03-15
Medium Priority
Last Modified: 2007-12-19
Good evening,

I am having problems with setting fonts using DirectX7, mainly dealing with the directdrawsurface7.setfont() function. everything else seems to be working wonderfully.

The acctual problem is the setfont function wants me to pass a IFont type (Interface) object, and I cannot create a instance nor can I inherit the Interface by another class. Is there any work around API I can possibly call or is there anyway to create a IFont Type.

Thanks for your help

Chris The Avatar
Question by:ChrisTheAvatar
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 8148908
You must be using VB.  According to microsoft archived content:

The IFont class is used by the DirectDrawSurface7.SetFont method to specify the font used in the DirectDrawSurface7.DrawText method.

For information on this class and its associated methods, see the Font class documentation in Visual Basic.

My guess from this, dim an "IFont" object.  If that doesn't work, dim a "Font" object.

Expert Comment

ID: 8187241
Dim myFont As DxVBLib.IFont

Expert Comment

ID: 8207500
Get the hFont (handle to font) information and pass it by reference (which in turn becomes an IFont).

You should be able to create a handle for a font and set the properties.

This should work with C#.


Accepted Solution

jongoldfish earned 500 total points
ID: 8217823
Hey Chris,

I don't know C#, but I am curious as to why you are using DirectX7?  DX9 has been out for a couple/few months now...

Expert Comment

ID: 8416828
A C-- Why did I only get a C grade?  Isn't C sorta like failing on this site...?

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month14 days, 16 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question