What is the difference between const TCHAR* tempString and LPWSTR? According to msn.microsoft website LPWSTR is
typedef wchar_t* LPWSTR, *PWSTR
so LPWSTR is just a convention for easier...
Type: Posts; User: derder
What is the difference between const TCHAR* tempString and LPWSTR? According to msn.microsoft website LPWSTR is
typedef wchar_t* LPWSTR, *PWSTR
so LPWSTR is just a convention for easier...
Hello, I am trying to display the text in win32 console window using DrawText after loading the string lines from a text file.
Here's the code for the file loading:
...
Hello,
I have a class in ClassManager.h declared as follows:
#include "DebugWriter.h"
class OutputManager : public DebugWriter {
Hello,
I am trying to understand how C++ object behave in the following case.
I declare a handle using windows HDC as follows: HDC myHDC.
version 1:
My function is delcared as follows:
...
Hello,
I have delcared a class with enum as follows:
class TokenPrint {
protected:
public:
static enum TokenType {TOKEN_ANCHOR=0, TOKEN_ARGUMENT_STRING=1,
TOKEN_ARGUMENT_INT=2,...
I am disgressing from my original subject in this post a bit, but I tried calling with string& and got a compiler error. Here's what I have delcared:
TokenItem::TokenItem(char del, string &tok)...
Question #3 When a C++ copy is made, does it make a deep copy or shallow?
I would all the primtivies such as int and anything can added to a stack is copied.
How would an C++ object inside an...
I need to know when a C++ class is deallocated if it's inserted into a vector but later goes out of scope because it exits from a function call.
I have written a function called Tokenize that...
I've found this code on the net:
void Tokenize(const string str, vector<string>& tokens, const string& delimiters){
int startpos = 0;
int pos = str.find_first_of(delimiters, startpos);...
Thanks!! That was the answer I was looking for. So it seems passing objects without references is a much object-oriented and cleaner way of doing things. On the other hand, it's not very efficient.
...
That's say at the main.cpp, I declare the myObj globally as follows:
object_type myObj;
Then at the main routine I have the following code and later passed to myFunctionReference and...
I initially asked if objects are created in my declaraton:
DCManager dcManger;
You said no. However reading your quote above, it seems you need to add a default constructor. This implies that...
Hello,
I was playing around with LoadBitmap. Originally I got it working. Then the screen it load was "white" meaning the HBITMAP it returned was not NULL, but it was just as if nothing is...
I don't know what this means. I used Visual C++ 2011 expression to create a new C++ project.
I haven't been programming for 4 years. The language I am thinking off when I wrote the question was c pointers. I can visualize c pointers as follows:
int x=0;
int *y=&x;
int z=0;
...
If no then why is it in my code
DCManager dcManager;
...
WM_CREATE:
dcManager= DCManager(dcImage);
I was too vague on the pass by reference with question 2. Here's what I meant:
public:
MYObj myObj;
OutputManager::OutputManager(MyObj &_myObjArg) {
myObj= _myObjArg;
}
Ok, so I added a default constructor after the compiler complains. In the WM_CREATE method, what happens when I create another object dcManager= DCManager? Is the previous dcManager created during my...
Hello,
I have a class that is instantiated as follows:
It seems the compiler complaines that there's no default constructor when I use the following code "DCManager dcManager". This tells me...
Hello,
I need to create a compatible DC and compute a font height. Both of these initialization steps require a handle to the device context called HDC.
Should I create them in InitInstance...
How do you add code to "do all the drawing"? Perhaps I use a timer or registered mouse move to call the draw routine? Is there a synchronized clause to make sure there's no race condition?
Wow! Thanks for the task manaager info. It took me a few seconds to figure out how to add the "GDI Objects" as a column. Once I got it, I think that really helps!
What do you mean take it back out. I thought you meant put it back in. My code puts in bmTest and hfFontDefault into image_dc. Next I use the select object as follows: SelectObject(image_dc,...
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
hfFontDefault = CreateFont(lfHeight, 0, 0, 0, 0, TRUE, 0, 0, 0, 0, 0, 0, 0, _T("Times New Roman"));
bmTest=...
What is the difference between
TokenItem *tok = new TokenItem(); delete tok;
and
TokenItem tok = TokenItem();
In the later example, I suppose there is some sort of mechanism to track the...