|
|
A dialog is the object that comes from a class, so you have a variable that must be instantiated.
In a modeless dialog, you can use, for example, a pointer to that class, and then reserve memory for that variable using the new clause. Once this has been done you can use CreateDialog in order to create that dialog and once this is done, you can use showwindow ...
if it is modal, it's far easier, you have that variable (e.g: CDialog Dlg; ) and then you have only to call DoModal() ;
But I think that the best you can do is to document yourself a little bit more. It is very important to get the basics very clear before trying to go further.
Hope this helps.
|
|
|
|
|
Hi all
I need to plot values on a graph. Say for example I have an two integer vector
4,2,3,5,6,7
0.564,0.656,1.6456;
now i want to plot these values. What's the best way to do that?
I saw a Plot Graphic Library on this webpage "http://www.codeproject.com/miscctrl/pgllib.asp" but it not work with in VS2005, it will give some error.
error C2923: 'std::list' : 'std::vector<hull::tlineapproximator<t>::SPoint>::const_iterator' is not a valid template type argument for parameter '_Ty'
at
typedef std::vector<spoint> PointContainer;
//! Key containers
typedef std::list<pointcontainer::const_iterator> KeyContainer;
Can anyone help me what's wrong with "pgllib".
Thanks in advance
|
|
|
|
|
Why you are spamming[^] the forum ? Can't you be little patience?
|
|
|
|
|
Hai.
I am developing a VC++ app for a pendrive..
I want to know the available freespace in the drive..
Are there any APIs which i can use in my app to get the available free space in the drive..Iam not having any driver installed.
Waiting for suggestions..
Thanks in advance
Regards
vijay
|
|
|
|
|
Check out GetDiskFreeSpaceEx()
|
|
|
|
|
Thanks for your suggestion.
But in the parameters of the function, the directory name has to be given, but here iam having only handle of the device.Will it be ok with it or any other suggestions..
Here iam not having any driver installed..
Regards
vijay
|
|
|
|
|
If there is no driver for the drive, how do you plan on accessing the drive at all?
|
|
|
|
|
Still now i am able to get the device descriptions without the help of driver and i want to proceed further. I got the handle to the device.
Can we do anything with the handle to get the solution.
Anyway the driver is going to do evrything with the help of handle only na..
Regards
vijay
|
|
|
|
|
Hi
I want to make array of objects without default constructor
#include <iostream><br />
<br />
using namespace std;<br />
<br />
class one <br />
{<br />
int t;<br />
public: <br />
one(int x):t(x) { cout << "Ctor" << endl;};<br />
<br />
};<br />
<br />
int main(void) {<br />
one* o[8];<br />
for ( int i = 0; i < 8 ; i++)<br />
{<br />
o[i] = new one(3);<br />
}<br />
delete[] o;<br />
}
I tired this. But it gives me run-time error with Vs 2005.
What is the problem?
Thanks
|
|
|
|
|
Hi,
instead of deleting the array
delete[] o; which you can't or at least shouldn't because its not allocated (hence it isn't on the heap but on the stack).
You need to delete the allocated one objects one by one
for ( int i = 0; i < 8 ; i++)
{
delete o[i];
}
codito ergo sum
|
|
|
|
|
|
sawerr wrote: one* o[8];
As told already, this is array of pointer to one . And Created on stack, so you dont need to worry about its memory.
And you need to free pointer memory for each index , which is allocated on heap.
|
|
|
|
|
Hi there
Since a sereval time i have very often strange problems with local variables.
char xxx[10] will cause an DebugHeapError by destruction ( if the function terminates )
a char *xxx = (char*)malloc(sizeof(char)*10); with a free(xxx); resolves the problem
a special DBF-Type (Date4) causes the same error.
The parameter pb from the function-calling static int __cdecl checkBytes(unsigned char * pb, ...
is unreadable (which causes the error)
Why are this kind of errors produces ( and why not since the begeinning of the project )
Big thanks
-- modified at 6:08 Monday 5th March, 2007
i debug the function which causes the error, now i see that the Date4 Pointer ( i changed the locale Date4 into a Date4*) will be overwritten with data at the initialisation of a char sss[10];
Why does the memory will be overwritten?
|
|
|
|
|
baerten wrote: Why does the memory will be overwritten?
Because you are probably somewhere writing out of the bounds of an array. This will also give you the heap error.
|
|
|
|
|
After checking 2500 lines of code ...
it was indeed a corrupt char-array which provokes the overflow
Thanks for your help
it's funny or more sadly, that a stupid error like this one happens at the first time of coding and
now after x years LOOOL C# with his strings makes the life too easy
|
|
|
|
|
baerten wrote: C# with his strings makes the life too easy
Just use a std::string in C++, that also make life easier
|
|
|
|
|
Yes, you need to show relevent code.
|
|
|
|
|
Hi everybody!
Is there any method to list the files of a directory in MFC?
|
|
|
|
|
http://www.codeproject.com/cpp/recursedir.asp
and
http://www.codeguru.com/forum/showthread.php?t=371635
-------------------------
Don't worry, be happy )
|
|
|
|
|
|
Hi guy's
i have example project downloaded from "code project.com", this could
be run successfully on visual studio 6 but when i try to run on visual studio
2005, it gives some more error, one of them is,
error C2923: 'std::list' : 'std::vector<hull::tlineapproximator<t>::SPoint>::const_iterator' is not a valid template type argument for parameter '_Ty'
that code snippet,
//! points container
typedef std::vector<spoint> PointContainer;
//! Key containers
typedef std::list<pointcontainer::const_iterator> KeyContainer;
the link of that one is http://www.codeproject.com/miscctrl/pgllib.asp[^]
can you help me what really going there.
thanks in advance
|
|
|
|
|
Provide more information please; show the code in question and indicate the line where the error in generated.
Steve
|
|
|
|
|
Hi
In my application ,I have a clock with a single line revolving at the rate of 1rev/sec.
But i get a flickering display every time the hand moves round the dial. what do i do to avoid the flicker?
Mine is dialog based display , the static text box is the canvass for the display.
Pls help
|
|
|
|
|
Where you have written code for this ?
Overrid WM_ERASEBKGND and simply return TRUE from it.
|
|
|
|