|
|
I have looked there earlier this week, i have examined there code, and i have found no allusion to what the answer to my problem is, i am doing everything that they do very similarly and it isn't working, i don't know why, and i don't know why i would be getting the ERROR_SUCCESS thing. if you could help me with that, it would be greatly appreciated
-Matthew
|
|
|
|
|
Have you tried calling GetLastError after the failure point?
In the same way that UN*X and MS-DOS library/system calls set errno to indicate a specific cause for error, this might lead you somewhere, even if it's only "invalid argument"
Steve S
|
|
|
|
|
Did you not see that? The first thing happening after CreateWindowEx() fails is GetLastError() gets called.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Not until after I'd written my reply
I should've reread the whole thread from the root message first!
Steve S
|
|
|
|
|
super_matt wrote:
i am doing everything that they do very similarly and it isn't working
I realize it's only two words, but therein could lie the answer. I've not looked at the referenced Web site, but perhaps it would be worth your time to compile that project to make sure it works, and then retrofit it with some of your code until the problem surfaces.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I have taken working procedural code and tried to object orient it, all i really changed was instead of executing global methods i execute class members. i have made sure that works, i have tried procedural code executing those class members, it works. the only thing i really changed was making my WndProc static, and passing (void* this) to it as the LPVOID param, then casting it back. i think my problem is maybe in my WndProc method, but i don't know what it is. I have tried making my WndProc call MessageBox() and create a message box that tells that it was entered, i read that WndProc is called before CreateWindowEx or CreateWindow returns so, those messageboxes should appear, but they aren't so i can only assume that therin lies my problem.
here is my WndProc:
LRESULT CALLBACK GLWindow::WndProc(HWND hWnd,
LPARAM lParam,
WPARAM wParam,
UINT uMsg)
{
// GLWindow is my window class, i am trying to create a wrapper to create openGL windows
GLWindow* pWnd;
if (uMsg == WM_NCCREATE)
{
MessageBox(hWnd,"WM_NCCREATE","WndProc Message",MB_OK | MB_ICONINFORMATION);
assert(((LPCREATESTRUCT(lParam))->lpCreateParams));
SetWindowLong(hWnd, GWL_USERDATA, (long)((LPCREATESTRUCT(lParam))->lpCreateParams));
}
else if (uMsg == WM_CREATE)
{
MessageBox(hWnd,"WM_CREATE","WndProc Message",MB_OK | MB_ICONINFORMATION);
assert(((LPCREATESTRUCT(lParam))->lpCreateParams));
SetWindowLong(hWnd, GWL_USERDATA, (long)((LPCREATESTRUCT(lParam))->CreateParams));
}
pWnd = GetGLWindowPtr(hWnd);
if (pWnd != NULL)
return pWnd->MsgHandler(hWnd, uMsg, wParam, lParam, pWnd);
else
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
can you see my problem?
-Matt
|
|
|
|
|
hi
Can ne 1 tell me how I can access COM Ports using MFC
I have a semester proj
bye
raheela
|
|
|
|
|
Depending on the level of access required, answers may vary.
http://www.codeproject.com/managedcpp/howtocomport.asp
http://www.codeproject.com/system/serial_com.asp
http://www.codeproject.com/system/serial.asp
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I don't know if there is a way to delete a member variable automatically, but I can't figure it out. Like in Visual C++ 6, if you add a member variable, you can go to the class wizard and remove it. Visuall C++ 6 automatically remove that variable from the project automatically.
But I could not find way to delete a member variable in Visuall C++.net. I have to go to the class to manually remove it, then I have to manually delete it from the DDX control as well.
Is there another way to delete member variable in VC++.net as does in Visual C++ 6?
|
|
|
|
|
I am not aware of any such possibilities in .NET but you could simply use the "Find in Files" utility giving your memeber variable as the search word which gives you a list of all accurances of this word.
Bunburry
|
|
|
|
|
Here is how i get that list : i call GetTrueTypeFonts with chtypeface = "" (see code);
EnumFontFamiliesEx calls the call back functions GetFaceName and GetStyleName.
Problem : if i test with FontData.lfCharSet = ANSI_CHARSET
i don't get fonts such as wingdings, symbols, .... (these fonts contain 'decorative' symbols). If i use DEFAULT_CHARSET, i get those wingdings etc... , but lots of the fonts included with ANSI_CHARSET are now missing.
The documentation says :
"If set to DEFAULT_CHARSET, the function enumerates all fonts in all character sets. If set to a valid character set value, the function enumerates only fonts in the specified character set."
So i thought that i would get all with DEFAULT_CHARSET.
(MapDefPolice is a CMap that collect all the fonts)
void GetTrueTypeFonts(const char *chtypeface, MapDefPolice *pMap)<br />
{<br />
LOGFONT FontData;<br />
strcpy(FontData.lfFaceName, chtypeface);<br />
FontData.lfPitchAndFamily = 0;<br />
FontData.lfCharSet = ANSI_CHARSET;<br />
HDC hDC = ::GetDC(NULL);<br />
EnumFontFamiliesEx(hDC, &FontData, <br />
chtypeface[0] ? (FONTENUMPROC)GetStyleName : (FONTENUMPROC)GetFaceName, <br />
(long)pMap, 0);<br />
::ReleaseDC( NULL, hDC);<br />
}<br />
<br />
int CALLBACK GetFaceName(ENUMLOGFONTEX *lpelf, NEWTEXTMETRIC *lpntm, DWORD FontType, LPARAM lParam)<br />
{<br />
if (FontType & TRUETYPE_FONTTYPE)<br />
GetTrueTypeFonts(lpelf->elfLogFont.lfFaceName, (MapDefPolice *)lParam);
return 1;<br />
}<br />
<br />
int CALLBACK GetStyleName(ENUMLOGFONTEX *lpelf, NEWTEXTMETRIC *lpntm, DWORD FontType, LPARAM lParam)<br />
{<br />
DefPolice *pDefPolice;<br />
long ID = GetTrueTypeID(lpelf->elfLogFont.lfFaceName, lpntm);<br />
MapDefPolice *pMapDef = (MapDefPolice *)lParam;<br />
pDefPolice = new DefPolice;<br />
pDefPolice->No = ID;<br />
ZeroMemory(&pDefPolice->Bits, sizeof(FontBits));<br />
pDefPolice->Bits.state = FONT_STATE_NEW;<br />
pDefPolice->strDescription = lpelf->elfLogFont.lfFaceName;<br />
pDefPolice->strDisplayName = lpelf->elfFullName;<br />
pDefPolice->Bits.weight = lpelf->elfLogFont.lfWeight;<br />
pDefPolice->Bits.bItalic = lpelf->elfLogFont.lfItalic;<br />
pDefPolice->Bits.bBold = ((lpntm->ntmFlags & NTM_BOLD) != 0);<br />
pDefPolice->Bits.bTrueType = 1;<br />
pMapDef->SetAt(pDefPolice->No, pDefPolice);<br />
return 1;<br />
}
|
|
|
|
|
Odd. Are you sure that FontData.lfFaceName is '\0' ? Is the value for FontData.lfPitchAndFamily filtering anything out?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Problem solved : the fonts wingdings, symbols, ... are in the SYMBOL_CHARSET charset.
So a first call with FontData.lfCharSet = ANSI_CHARSET will get the standard fonts, and a 2nd call with FontData.lfCharSet = SYMBOL_CHARSET get the rest.
|
|
|
|
|
how to implememt "search text" in CHtmlView?
includeh10
|
|
|
|
|
|
A call to any CTime member function causes unhandled exceptions, access violation. Any ideas why?
|
|
|
|
|
Daniel1324 wrote:
Any ideas why?
Not without a code snippet that exhibits the problem.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
|
|
I'm curious what you expected to come from an uninitialized object? Even though CTime::GetYear() is dereferencing a NULL pointer, it doesn't make sense that you'd assume valid data would be returned.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
My fault. I was assuming that it would return date and time stored in the system.
|
|
|
|
|
Is there a way to assign a version number to any type of file?
INI, DOC ... TXT.
thank you
|
|
|
|
|
If the file is part of some 'version control' system, then you likely can do what you are after. But the short answer is no, I think.
Chris Meech
It's much easier to get rich telling people what they want to hear. Chistopher Duncan
But for a man, barbecuing eggplant and portobello mushrooms is a sure way to have people question your sexual orientation. Kuro5hin
|
|
|
|
|
Yes. Within Windows Explorer, right-click the file and select Properties. Click the Summary tab. Enter a version number in the Revision Number box. This number, and the other pieces of information, are stored in the file itself. This is called structured storage.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|