|
|
|
Could there exists a conflict between header files, for example i'm including all of the header files, but the only one that is causing the error is pdh.h .... I'm well aware of the fact that the error occuring in the header file is not caused by faulty code.
windows.h
winbase.h
sql.h
sqlext.h
stdlib.h
mbstring.h
conio.h
exception
odbcinst.h
shellapi.h
winuser.h
exception
fstream
lm.h
Lmjoin.h
shlobj.h
Winreg.h
shlwapi.h
tchar.h
pdh.h
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
O.k, when I exclude the header files:
lm.h
Lmjoin.h
The error goes away and the dll compiles, but why would this be, the thing is I need both of those header files and the pdh.h header file.
Any suggestions???
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
i see somethings that could produce this :
some of the headers (in the list you provided) already include some others and some of the headers don't have an auto exclusive include statement like :
#pragma once or
#ifndef __MY_HEADER_H__
#define __MY_HEADER_H__
#endif
|
|
|
|
|
Hello
i'm a newbie here, i just want to ask if you an idea on how to pause a console app that is being spawned by the CreateProcess() function?
Thanks a lot.
i need to learn more... i want to be like you guys... i'm just a begginer
|
|
|
|
|
I don't think you can pause a process. Why don't you pause it inside the code of this console app itself ? What are you trying to achieve exactly ?
|
|
|
|
|
i was just hoping if i can pause a spawned process, maybe my ReadFile may return something from the application. because in my redirection class, it waited till the application fisnished before it can redirect its output into the editbox.
The thing is i have no coding access to the spawned process.
Actually if you will try to pause it manually, you can. by pressing the pause/break key.
i need to learn more... i want to be like you guys... i'm just a begginer
|
|
|
|
|
rupert_durans wrote: i'm a newbie here, i just want to ask if you an idea on how to pause a console app that is being spawned by the CreateProcess() function?
Have you tried CREATE_SUSPENDED . You can pass this flag to dwCreationFlags parameter of CreateProcess .
|
|
|
|
|
hello everybody !!
my new problem is that i have a class that contain a some functions and some variables
i want to execute one of these functions in a separate thread using AfxBeginThread(...);
and FYI this function uses some member variables of the class to do it's work
any idea ???
thnx 4 ur time and concern
a.hemdan
|
|
|
|
|
Pass the address of the instance of the class from which you want to call a member function as an argument of your thread. When you start a thread, you can pass a user defined parameter that will be passed to the function of your thread. There, pass the pointer to your class instance. In your thread function, cast it back to the class pointer and call the member function.
|
|
|
|
|
Hi
I have a friend who somehow encountered that and i remembered that he made a structure of the class and pass it on to the thread so that the member viriable can be used by the thread.
Try to research about worker thread and UI thread, you may find how to use member viriables of a class inside the thread by using struct.
Hope i have helped you somehow.
i need to learn more... i want to be like you guys... i'm just a begginer
|
|
|
|
|
rupert_durans wrote: he made a structure of the class and pass it on to the thread so that the member viriable can be used by the thread
What do you mean by making a structure of the class ? Why not simply pass the address of the class instance (the this pointer) to the thread ?
|
|
|
|
|
yup,
i asked him again and you are right, you may or may not create struct as long as it points to the class instance.
i need to learn more... i want to be like you guys... i'm just a begginer
|
|
|
|
|
Ok but why do you want to do such a thing ? What is the advantage of wrapping your class into a structure just to pass it to your thread ? Pass it directly, it's much cleaner. Why adding complexity where this is not required ?
|
|
|
|
|
hehehe, soweee, i'm just a newbie, i just saw it on my friend's code...
now i know that it can be direct,
can you please give me example on how to declare a pointer to the class instance?
i need to learn more... i want to be like you guys... i'm just a begginer
|
|
|
|
|
rupert_durans wrote: can you please give me example on how to declare a pointer to the class instance
You don't really 'create a pointer to the class instance'. What you have in fact is an instance of your class:
CMyClass Inst;
Here, Inst is an instance of CMyClass. The address of this class is obtained with the & operator:
CMyClass* pPointer = &Inst;
If you pass this address as a parameter to your thread function, you'll be able to access its member:
void MyThreadFunc(LPVOID pParam)
{
CMyClass* pClass = (CMyClass*)pParam;
pClass->MemberFun();
}
You can also start your thread inside a member function of your class, then simply pass the this parameter:
void CMyClass:SomeFunction()
{
_beginthread(MyThreadFun,0,this);
}
|
|
|
|
|
thank you
i need to learn more... i want to be like you guys... i'm just a begginer
|
|
|
|
|
Cedric Moonen wrote: You don't really 'create a pointer to the class instance'. What you have in fact is an instance of your class:
CMyClass Inst;
Here, Inst is an instance of CMyClass. The address of this class is obtained with the & operator:
CMyClass* pPointer = &Inst;
Hi Cédric,
Isn't "Inst" an instance of the class and "pPointer" a pointer to an instance of the class?
Mark
|
|
|
|
|
is it like this one for example?
CMyFileSpyDlg* _this;
i need to learn more... i want to be like you guys... i'm just a begginer
|
|
|
|
|
can you also answer my question above?
HOw to pause a spawned process?
i need to learn more... i want to be like you guys... i'm just a begginer
|
|
|
|
|
Hi ,
I want to force my Edit box to get unicode characters.
Because I am using Arabic/Persian characters and I want to get codes
from EditBoxes and It is diffrent to get Ascii or unicode.
please help me.
thanks.
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
compile your app with UNICODE,_UNICODE preprocessor definitions
Greets,
Davy
|
|
|
|
|
dSolariuM wrote: Because I am using Arabic/Persian characters and I want to get codes
from EditBoxes and It is diffrent to get Ascii or unicode.
make you project unicode enabled, you can change it in Project properties or using _UNICODE macro in stdafx
"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, everyone
We occurs a problem that our pogram occupies a very high CPU Usage even if with no any operation on it.
And we really want to know what leads to the HIGH CPU USAGE? I have searched a lot of topic about this. But...
I just consider the large amount of user objects occupies the CPU. But if the large amount of user objects will cause the high CPU Usage?
(NOTE:Our project has a large amount of user object of 8597.)
THANKS.
//////////////////////////////
|
|
|
|