|
Yeah, I know. I was in the same habit from my 'C' days. The 'delete NULL ' thing only works in C++ AFAIK. In C, calling free(NULL); had unpredictable results, depending upon the run-time library implementor. I would imagine it's part of the standard, now.
Software Zen: delete this;
|
|
|
|
|
Hi,
How to change the dialog's caption at run time, I tried this by calling
(GetDlgItem(IDD_DIALOGiID))->SetWindowText("Test Dialog Caption") in OninitDialog method, but it is not working.
Warm Regards,
Mushq
|
|
|
|
|
Don't know y r u calling GetDlgItem(). This function is used for Child windows/controls in a Dialog.
U can directly call SetWindowText ("Test Dialog Caption") from any member of Dialog.
Come online at:-
jubinc@skype
|
|
|
|
|
use this->SetWindowText
If u can Dream... U can do it
|
|
|
|
|
Try SetWindowText("Test Dialog Caption");
|
|
|
|
|
this->SetWindowText("MYDIALOG");
Code-Frog:So if this is Pumpkinhead. Time for him to run and hide. It's an interesting thought really.
|
|
|
|
|
Hi
I have been created a class called CMine in a MFC Dll project and in another MFC project I created an object if that class (I added header and lib file to the project).
I found that I must write __declspec(dllexport) before all functions in my CMine class, is there any way to avoid this, or just declaring one thing?
Thanks
|
|
|
|
|
Declaring _declspec(dllexport) in front of each and every member is not needed. Just write like this in the dll:-
class _declspec(dllexport) CTest
{
public:
void fnTest()
{
...
}
};
In .EXE:-
class _declspec(dllimport) CTest
{
public:
void fnTest()
{
...
}
};
It will surely work.
};
Come online at:-
jubinc@skype
|
|
|
|
|
|
Hadi Dayvary wrote: Yes, thank you
or you can write AFX_EXT_CLASS, in case of class
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Hi everybody!
Does anyone of you know any specific function to find the last modified time of a file.If anyone of you know this, i humbly request you to respond me.
Thanks in advance!
Shalumalu
|
|
|
|
|
|
Use FindFirstFile(). It accepts a structure, WIN32_FIND_DATA.
ftLastWriteTime member of this structure contains the modified time.
Jubin Chawda,
S.E. (VC++)
Come online at: jubinc@skype
|
|
|
|
|
There's also GetFileTime().
Mark
|
|
|
|
|
ShaluMalu wrote: Does anyone of you know any specific function to find the last modified time of a file.If anyone of you know this, i humbly request you to respond me.
GetFileAttributesEx
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Hey All
I m trying to make an online application using VC++ & Oracle 9i.If anybody can help me in connecting the application to the oracle database that is stored on the server i.e on a remote location on a WAN(Wide Area Network).
Thank you
Regards
Pankaj
|
|
|
|
|
Use ADO
Come online at:-
jubinc@skype
|
|
|
|
|
Don Box wrote: [Click for User Profile] Don Box
are you really COM Guru.. Don Box?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
pan_angel wrote: remote location on a WAN
I don't believe you can connect to any Db server on a separate subnet (as implied by your post).
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
Hello, I am Sauce! and this is my first post on these forums. In my current project, I am using DirectX (specifically, D3D) to create a small 2D game. In the current stage of my project, I am setting up D3D to render textured quads, following along with the tutorial that can be found here, at www.gamedev.net.
I am getting two compile errors in my code, both of which are related; they are:
.\BiggerFish.cpp(114) : error C3861: 'Render2D': identifier not found
.\BiggerFish.cpp(204) : error C2365: 'Render2D' : redefinition; previous definition was 'formerly unknown identifier'
The first of these errors refers to my Render() function:
void Render()<br />
{<br />
if( g_pd3dDevice == NULL )<br />
return;<br />
<br />
g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,255), 1.0f, 0 );<br />
<br />
g_pd3dDevice->BeginScene();<br />
<br />
Render2D();<br />
<br />
g_pd3dDevice->EndScene();<br />
<br />
g_pd3dDevice->Present( NULL, NULL, NULL, NULL );<br />
}
and the second refers to my Render2D() function:
<br />
void Render2D()<br />
{<br />
g_pd3dDevice->SetVertexShader(D3DFVF_PANELVERTEX);<br />
g_pd3dDevice->SetStreamSource(0, g_pVertices, sizeof(PANELVERTEX));<br />
g_pd3dDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, 0, 2);<br />
}
The compiler seems to think that I am redefining Render2D() when I call it on line 114 (in my Render() function), however I am not. Simply adding void in front of Render2D() when I call it eradicates this problem, however I believe that this is actually incorrect and the way my code is currently written is the correct way. Can anybody tell me the correct way to be doing this?
EDIT: I should probably point out that I am using Microsoft Visual C++ 2005 Express Edition. I have the Platform SDK installed, and the DirectX8 SDK.
-- modified at 23:08 Friday 12th January, 2007
|
|
|
|
|
Try putting the Render2D() function above the Render() function in your source code. That way the compiler will have seen the Render2D() before it is called from the Render() function.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Is Render2D a DirectX SDK function then u may forget to include the desired header file that u need to for compiling i.e why it is giving "identifier not found"
Regargs
Pankaj
|
|
|
|
|
No, Render2D() is not a DirectX function, however Render() is. It is simpler to render the 2D stuff and 3D stuff seperately (for example, render the 2D GUI seperately from the game world)
Your thoughts are however, always appreciated
PJ Arends, your suggestion works perfectly. It even solved another problem I was having with my code, whereby a small rectangle was not being rendered. Thankyou for your insight.
I know for a fact that this website will be of use to me in the future.
|
|
|
|
|
This must sound really stupid, but i can't access my button properties. I decided to do a full mfc project for the first time with visual c++ 7 and for now it's really a pain in the ass.
Here's my code in the buttonclick event.
if (this->Test2->Caption == "On")
this->Test2->Caption = "Off";
else
this->Test2->Caption = "On";
at first I tried without the this and it didn't worked either. What am i doing wrong?
|
|
|
|
|
What are Test2 and Caption?
Have you tried using GetWindowText() and SetWindowText()?
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|