|
This works fine so I'm not sure what you are doing to get an error.
Output is..."Member variable of b = 22"
// b.h ********************
#include "stdafx.h"
class a;
class b
{
public:
int m_a;
b();
virtual ~b();
};
// b.cpp ********************
b::b() : m_a(22)
{
}
b::~b()
{
}
// a.h ********************
#include "stdafx.h"
class b;
class a
{
public:
void SomeFunction();
b* m_pb;
a();
virtual ~a();
};
// a.cpp ********************
a::a() : m_pb(NULL)
{
m_pb=new b();
SomeFunction();
}
a::~a()
{
if (m_pb) {
delete m_pb;
}
}
void a::SomeFunction()
{
if (m_pb) {
int Member_Variable_of_b=m_pb->m_a;
TRACE("Member variable of b = %d\n",Member_Variable_of_b);
}
}
|
|
|
|
|
I am developing a multi-people chat game.I want to use RTC achitecture I don't known RTC very well.Some people would give me a guid to reach it?
Thanks.
|
|
|
|
|
|
I know what you mean. But I think it may not be detailed enough.And my English is a little poor,so I have some difficulty to read it.Can you give me a guid of the steps of doing so?
Thanks.
|
|
|
|
|
It's not an easy protocol to implement. I looked into using it in the past and decided not to,
mostly because I didn't have the time or resources to develop another server.
So, unfortunately, I have no sample code. You could try Google...lots of links there.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Oh,I see what you mean.Thank you all the same.
|
|
|
|
|
Hi,
Can you tell me how to read text from screen (screen text hooking) using VC++?
Thanks.
Hung
|
|
|
|
|
hung_ngole wrote: Can you tell me how to read text from screen (screen text hooking) using VC++?
Look up IAccessible . Also look up like AccessibleObjectFromPoint , AccessibleObjectFromWindow .
|
|
|
|
|
hi,
I start my application (on 2k, XP, NT, Vista) before the shell "explorer.exe" is loaded, meaning also before all user defined processes start, except those run as winlogon notifier packages. The problem is with a new start of the computer all services are loaded before and while the user is logging on. This takes a lot of processor time and my application has some delays I don't want. So my question is:
1) Is there a way to check whether all services, that should run have already started?
or
2) Is there a way (maybe an event) to get the processor idle time? And what would be a critical value for believing that the processor is idle?
2.1) Or is there a way to give my running application a higher priority so that it can use the processor time whenever it needs it?
thank you for you suggestions.
regards
|
|
|
|
|
1 and 2 are certainly do-able - I'd question wether it was necessary ...
You say 'I start my application' .. that implies its not a service (in my mind) - why dont you make it a service, then give it a dependancy of another service lower down the startup chain (that might take experimenting with to find the right one)
'g'
|
|
|
|
|
hi,
I start the application with the an replacement of HKLM->Software->Microsoft->Windows NT->CurrentVersion->Winlogon->Userinit
to guarantee that the shell is not loaded unless my application allows it. It's some application for user checking.
I don't want to run it as a service because it uses an user interface and other stuff, which make it not advisable to do it as a service.
What exactly do you mean by "lower down the startup chain"? Reducing the number of services starting? This wouldn't be acceptable.
|
|
|
|
|
Gurkenscheibe wrote: lower down the startup chain
no, I mean services start up usually in a set order - you make your service dependant on one of these .. but you dont want to create a service .. hmmm
how about using something like this http://www.codeproject.com/system/xyntservice.asp[^] to start your program, rather than the reg key - Im pretty sure you can still start this service dependant on another service being 'started' - that might give you what you need
|
|
|
|
|
Gurkenscheibe wrote: to guarantee that the shell is not loaded unless my application allows it
What about replacing HKLM->Software->Microsoft->Windows NT->CurrentVersion->Winlogon->Shell instead with your app. Your app can then provide it's interface and spawn explorer.exe if user is ok.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
1. As mentioned, when registering a service you can specify that it depends on other services. This makes the service manager check that the dependent services are running before it starts yours.
2. There are a couple of ways to check for idle time. Most are for checking time since last mouse/keyboard usage (which doesn't help you on machine startup).
One that may help is WaitForInputIdle: http://msdn2.microsoft.com/en-us/library/ms687022.aspx[^] You could get the handle of a process you know has to be running before yours (e.g. winlogon or explorer) and wait for it to idle.
If you are using Vista you may want to look at the new task manager interfaces like IIdleTrigger: http://msdn2.microsoft.com/en-us/library/aa380724.aspx[^]
For pre-Vista you may want to look at IScheduledWorkItem: http://msdn2.microsoft.com/en-us/library/aa381216.aspx[^]
2.1 SetPriorityClass: http://msdn2.microsoft.com/en-us/library/ms686219.aspx[^] but i don't think this will help you in any way.
I would try using WaitForInputIdle on winlogon.exe or explorer.exe.
If that didn't work i would write a small service that was dependent on one i knew needed to be started and have your app wait on your service (e.g. either through checking service via service manager, or have service create a named mutex, ...).
...cmk
Save the whales - collect the whole set
|
|
|
|
|
I m trying to make .dll file to be used in labview
but I have problem
thanks to help me
|
|
|
|
|
|
thanks
I had seen it
but I have problem in compiling
I have the string.h in my include dir , but it has a error on it yet.
|
|
|
|
|
Please dont mistake me but seriously,it's the dumbest question I've ever seen. How do people know your struck with string.h? and btw if you dont say the error you get there how do we know it? Can you dispaly the error please? and btw,
Tutorials for DLL are availabe in our own store. You may check it before you click somewhere out Clickety[^]
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
VuNic wrote: seriously,it's the dumbest question I've ever seen.
Nah, how about this one[^]?
I enjoy occasionally wandering around randomly, and often find that when I do so, I get to where I wanted to be [^].
Awasu 2.3 [^]: A free RSS/Atom feed reader with support for Code Project. 50% discount on the paid editions for CP members!
|
|
|
|
|
lol Anything involving VB6.0 should be the dumbest. I admit.
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
Nah, how about this one[^]?
I enjoy occasionally wandering around randomly, and often find that when I do so, I get to where I wanted to be [^].
Awasu 2.3 [^]: A free RSS/Atom feed reader with support for Code Project. 50% discount on the paid editions for CP members!
|
|
|
|
|
Is there any way to permanently show the vertical scrollbar on my List
Control, even when it is disabled, i.e. the number of rows does not exceed
the viewable area?
|
|
|
|
|
MFC VC 6.0 problem.
Could someone help me to fix this?
I changed my computer time and now I am getting this error.
I really do not need the help files at this point.
How do I delete them?
I tried to exclude all help files from compilation but it did not help.
Here is the error message
Making help include file...
'makehm' is not recognized as an internal or external command,
operable program or batch file.
'makehm' is not recognized as an internal or external command,
operable program or batch file.
'makehm' is not recognized as an internal or external command,
operable program or batch file.
'makehm' is not recognized as an internal or external command,
operable program or batch file.
'makehm' is not recognized as an internal or external command,
operable program or batch file.
Error executing c:\winnt\system32\cmd.exe.
Thanks for reading
|
|
|
|
|
In FileView, select the files you want to remove from the project, then press Delete.
|
|
|
|
|
I wish it was that simple.
It does not work.
I still get the same errors.
|
|
|
|