|
Thanks.I'll try.
|
|
|
|
|
Hi,
I need info about the WaitThreadFunc. All I know now is the function prototype =>
unsigned int __stdcall WaitThreadFunc(void * _param);
How does this function work?
|
|
|
|
|
Looks like a callback function.
If it is, then you need to implement it yourself and give the its name to the function that uses it.
this is this.
|
|
|
|
|
Hi,
I've developed an application where i'm readng some data from a file before the main window is created ,so accordingly i've placed the code in a class derived from CWinApp.When i compile and run the program itz doing well and i'm getting the desired output,But the problem starts when i click the EXE icon in the debug folder .
Itz giving out an error that the specified file could not be opened.Then i used FormatMessage to see what the error was and it says "The System Cannot Find The File Specified".How do i rectify this error?.It would be really great if someone can help me out in this.Thanks in advance.
rajeev
|
|
|
|
|
The file you are trying to open is located someplace else. You need to use the exact physical path of the file. You can use:
char szPath[MAX_PATH];<br />
GetModuleFileName(NULL,szPath,MAX_PATH);
It will return the path of this exe like: "c:\asd\debug\asd.exe"
And parse the returned string to remove the characters after the last backslash. Then append the name of the file you want to open.
this is this.
|
|
|
|
|
Hello, everyone,
Who know the different between C Struct and C++ Struct?
Please tell me?
|
|
|
|
|
In C a structure is a colection of data items only.
In C++ a structure is the same as a class, accept that the default access is public instead of private.
INTP
Every thing is relative...
|
|
|
|
|
DEAR SIR
can you give a example
I donot understand your say
----------------------------
Jerry yu
Chinese
programming fans
我的QQ 290785513
中国人的加我
|
|
|
|
|
in C++ :
<font color=green>
<font color=blue>struct</font> MyStruct {
<font color=blue>int</font> i;
<font color=blue>double</font> d;
};
will actually be seen by the compiler as the following code :
<font color=blue>class</font> MyStruct {
<font color=blue>public</font>:
<font color=blue>int</font> i;
<font color=blue>double</font> d;
<font color=blue>public</font>:
MyStruct() { }
<font color=blue>virtual</font> ~MyStruct() { }
};
see if you can find any differences...
in the same way, the following code wont compile with a pure C compiler :
<font color=blue>struct</font> Formula1 : <font color=blue>public</font> SportCar { <font color=green>
<font color=blue>private</font>: <font color=green>
Motor m;
<font color=blue>double</font> max_speed;
<font color=blue>public</font>:
<font color=blue>double</font> getMaxSpeed(); <font color=green>
};
TOXCCT >>> GEII power [toxcct][VisualCalc]
-- modified at 7:05 Saturday 19th November, 2005
|
|
|
|
|
guy .From your name I know you come from cn
两种结构体式一样的把
----------------------------
Jerry yu
Chinese
programming fans
|
|
|
|
|
in addition to what John said, a C++ structure can accept the following by opposition to C structs :
- visibility operators (public, protected, private)
- member functions
- inherit from another type
a C structure is so only an aggregation of several types, all public.
a C++ struct do is a class, but which members are public by default...
if you don't understand more, search for a C++ book and learn about the language.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hello,
A struct in C++ is the same as C. It's only there for compatibility with C. There is no real difference. When you use C++, you can add member functions and all the other stuff that you can use with a class. I can only advice not too do it. The main reason for this is that everybody uses a struct as a POD (Plain Old Datatype) and a class for dynamic objects.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Thank you very much. I find the real reason from your answer.
Yesterday, I read a block source code of C++. In it, I found some
structs are defined as C style, I feel very strange, So I ask this
question.
Now I understood it only want to treat the struct as a Datatype.
|
|
|
|
|
chenxiujie wrote: Thank you very much.
You're welcome!
Glad that you found my help usefull.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Hi,
On the end user machine I want to determine if the user has admin privileges available or he is a normal user. What is the right way of finding this out?
thanks!
|
|
|
|
|
You're better off determining exactly what priviledges/access rights you need, and testing for those specifically.
|
|
|
|
|
This is just a work around...
make call to OpenSCManager(..) to determine admin status of User, look at this code :-
OpenSCManager(NULL,NULL,SC_MANAGER_ALL_ACCESS);
if(GetLastError()==ERROR_ACCESS_DENIED)
{
MessageBox("User Is not Admin");
}
else
{
MessageBox("User is Admin");
}
"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
|
|
|
|
|
Remember to call CloseServiceHandle on the returned handle if the open is successful, or else you will have handle leaks in your application
The returned handle is only valid for the process that called the OpenSCManager function. It can be closed by calling the CloseServiceHandle function.
|
|
|
|
|
Blake Miller wrote: Remember to call CloseServiceHandle on the returned handle if the open is successful, or else you will have handle leaks in your application
Ohh I forget! thanks for correcting me
"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
|
|
|
|
|
in vc++ 6.0
first I build my dll in release mode and register, it works;
then I make some modification to the code and build it in debug mode. but now if I register it again , it dosen't work, without any infomation prompted. I just can't see the program change after I modify the code. e.g. in the modification I add a button to a dialog, but button would not appear when I excute it.
how come this happen?
Thank you very much!!!
-------------------
I am learning C++ and English
|
|
|
|
|
Hello, everyone,
If I want a class object to do Upcast,
the "reinterpret_cast" is needed? why ?
Thanks a lot!
|
|
|
|
|
I do not know, using reinterpret_cast is dangerous. I would think that you would need to use dynamic_cast instead.
INTP
Every thing is relative...
|
|
|
|
|
Hello everyone,
If I want a class become a singleton class, its Construct/Destructor
should be private, protected or public?
Who can give me the answer and the reason?
Thanks a lot , best regards.
|
|
|
|
|
1st : what is "singleton class" ?
if you put the constructors of a class in private, you will never be able to instanciate your class ; if you put your constructor protected, your class will behave as an abstract class, that mean only inherited classes will be able to instanciate it thru the inheritence.
2nd : [OT] you are not obliged to put a "Ask for help: " before every question you ask on the forum.... we guess it is for help.
3rd : i advise you to learn C++ with a book or whatever you want, but a source that can provide you strong basis...
sincerely,
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hello,
toxcct wrote: what is "singleton class"
It's a design pattern. I'm sure you know about it dont you.. See my other post in this thread for an implementation of a singleton class...
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|