Click here to Skip to main content
15,902,939 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCapture window bitmap from another running program Pin
MugWumpBW27-Oct-04 8:35
MugWumpBW27-Oct-04 8:35 
GeneralRe: Capture window bitmap from another running program Pin
l a u r e n27-Oct-04 15:10
l a u r e n27-Oct-04 15:10 
GeneralRe: Hiding Afx Pin
Maximilien27-Oct-04 7:52
Maximilien27-Oct-04 7:52 
GeneralRe: Hiding Afx Pin
jmkhael27-Oct-04 8:08
jmkhael27-Oct-04 8:08 
GeneralUnicode compiling Pin
Timothy Grabrian27-Oct-04 7:41
professionalTimothy Grabrian27-Oct-04 7:41 
GeneralRe: Unicode compiling Pin
l a u r e n27-Oct-04 15:11
l a u r e n27-Oct-04 15:11 
GeneralRe: Unicode compiling Pin
Timothy Grabrian27-Oct-04 15:25
professionalTimothy Grabrian27-Oct-04 15:25 
GeneralRe: Unicode compiling Pin
Ryan Binns27-Oct-04 18:40
Ryan Binns27-Oct-04 18:40 
KingKruncher wrote:
If I uncomment these 2 lines it gives a "unresolved external symbol" error for the functions in "RegHelpers.h"

You haven't really given enough information, but... Is RegHelpers.cpp compiled into a library? And if so, was the library also compiled for Unicode? If not, you'll get these errors. If it's not a library, does the header file use TCHAR and the cpp file use char? This will also cause these linker errors only for Unicode builds. Other than that, you'll have to give a bit more information.

KingKruncher wrote:
Do I need to do "new TCHAR[256 * sizeof(TCHAR)];"?

No. The [] verison of new allocates multiples of the data size, so new TCHAR[256] allocates 256 bytes for non-unicode builds and 512 bytes for unicode builds.

KingKruncher wrote:
Also should I change them from PTCHAR to LPTSTR?

It doesn't really matter - they are defined the same. Personally, I use PTCHAR for variables that are intended to point to a single character, and LPTSTR for variables that are a string, as that is what the names suggest.

KingKruncher wrote:
Do I really need to use the new operator on my strings?

You could allocate them on the stack like any other array, but if you need them to persist beyond a single function, then use new.

Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

GeneralHiding Afx Pin
Leyu27-Oct-04 7:28
Leyu27-Oct-04 7:28 
GeneralDrawing a line, fast! Pin
Obliterator27-Oct-04 6:43
Obliterator27-Oct-04 6:43 
GeneralPorting VB GUI to VC++ Pin
flashback827-Oct-04 6:39
flashback827-Oct-04 6:39 
GeneralRe: Porting VB GUI to VC++ Pin
BlackDice27-Oct-04 7:15
BlackDice27-Oct-04 7:15 
GeneralRe: Porting VB GUI to VC++ Pin
BlackDice27-Oct-04 7:19
BlackDice27-Oct-04 7:19 
GeneralRe: Porting VB GUI to VC++ Pin
flashback827-Oct-04 9:36
flashback827-Oct-04 9:36 
GeneralRe: Porting VB GUI to VC++ Pin
ThatsAlok27-Oct-04 18:58
ThatsAlok27-Oct-04 18:58 
GeneralCheck for Updates Pin
Anonymous27-Oct-04 6:04
Anonymous27-Oct-04 6:04 
GeneralRe: Check for Updates Pin
Ravi Bhavnani27-Oct-04 6:20
professionalRavi Bhavnani27-Oct-04 6:20 
QuestionIs the window on top? Pin
RobJones27-Oct-04 5:57
RobJones27-Oct-04 5:57 
AnswerRe: Is the window on top? Pin
David Crow27-Oct-04 6:04
David Crow27-Oct-04 6:04 
GeneralRe: Is the window on top? Pin
RobJones27-Oct-04 6:42
RobJones27-Oct-04 6:42 
GeneralFigured it out Pin
RobJones27-Oct-04 6:54
RobJones27-Oct-04 6:54 
GeneralC++ Windows Program Pin
Member 139789327-Oct-04 5:54
Member 139789327-Oct-04 5:54 
GeneralRe: C++ Windows Program Pin
David Crow27-Oct-04 6:08
David Crow27-Oct-04 6:08 
Generaldisplaying sequence of images in a dialog box Pin
witty6527-Oct-04 5:50
witty6527-Oct-04 5:50 
GeneralPlay a sound from a resource Pin
doctorpi27-Oct-04 5:21
doctorpi27-Oct-04 5:21 

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.