Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › C++/C Programming › Writing text with DirectX

Writing text with DirectX

Posts 1–10 of 10 · Page 1 of 1
KR
Kryo4lex
Writing text with DirectX
Hi guys , in the last days I read a lot about hooking and how to create a DirectX-overlay.

With the help of many tutorials I managed to create a injectable DLL.

Now I want to Print some text before the EndScene. I also did this with rectangles and it worked.

My problem is that all tutorials I found didn't work at all , or i guess im to stupid

Ok I used this tut from MPGH

 
i used the first method , here is the Code , I put this in a header and want to call it in the cpp file
Code:
void PrintText1(double x, double y, DWORD dwColor, LPD3DXFONT pFont, char *Text, ...)
{
	char buffer[256];

	//This is for handling the "..." parameters
    va_list argList;
    va_start(argList, Text);
    vsnprintf_s(buffer, sizeof(buffer), sizeof(buffer) - strlen(buffer), Text, argList);
    va_end(argList);

	//Our Rect to where the text will be printed
    RECT Rect =
	{
		x,
		y,
		x + 500,
		y + 50
	};

    pFont->DrawText(NULL, buffer, -1, &Rect, DT_NOCLIP, dwColor);
}


But always get this Error in Visual Studio 2010:
IntelliSense: argument of type "char *" is incompatible with parameter of type "LPCWSTR"

Ok and then my problem is how to call the function correctly

Have you any other suggestions to display text , or do you know why this isn't working?

THX in advance
#1 · 14y ago
Jason
Jason
Explicitly call DrawTextA instead of the DrawText macro, or change the character set of your project to "multi-byte"
#2 · 14y ago
KI
kibbles18
Or cast it as LPCWSTR
#3 · 14y ago
Jason
Jason
Quote Originally Posted by kibbles18 View Post
Or cast it as LPCWSTR
Casting doesn't work. A wide string can't be cast back and forth between to a C-string
#4 · 14y ago
NI
Nico
Quote Originally Posted by Jason View Post


Casting doesn't work. A wide string can't be cast back and forth between to a C-string
Not directly but there are ways to do it.
#5 · 14y ago
Jason
Jason
Quote Originally Posted by Nico View Post


Not directly but there are ways to do it.
I'm aware of that, but I just said a direct cast wouldn't work
#6 · 14y ago
NI
Nico
Quote Originally Posted by Jason View Post


I'm aware of that, but I just said a direct cast wouldn't work
Let's discuss more about that.
#7 · 14y ago
Jason
Jason
Quote Originally Posted by Nico View Post


Let's discuss more about that.
What more is there to discuss?
#8 · 14y ago
LA
lannyboy
LPCWSTR in msvc++ is wchar_t *.
you should declare UNICODE in your project.
#9 · 14y ago
Jason
Jason
Quote Originally Posted by lannyboy View Post
LPCWSTR in msvc++ is wchar_t *.
you should declare UNICODE in your project.
Thanks for being completely redundant. Toddle on.
#10 · 14y ago
Posts 1–10 of 10 · Page 1 of 1

Post a Reply

Similar Threads

  • Help With DirectX 9.0By GoBxHiTz in Combat Arms Hacks & Cheats
    12Last post 18y ago
  • Help with directxBy xtcevolution in Combat Arms Hacks & Cheats
    1Last post 17y ago
  • grab text and write text from addressBy CodeHPro in Visual Basic Programming
    4Last post 17y ago
  • [Source Help]Read/Write Text[Solved]By Samueldo in Visual Basic Programming
    4Last post 16y ago
  • OpenGL With DirectXBy kronus980 in General
    7Last post 16y ago

Tags for this Thread

#directx#display#print#text