|
Hi.
Thank for replying. But now I have another error:
error C2440: 'type cast' : cannot convert from 'class CDocument *' to 'class CVector_3DDoc'
No constructor could take the source type, or constructor overload resolution was ambiguous
What does it mean?
|
|
|
|
|
ReturnRain wrote: ...to 'class CVector_3DDoc'
The cast operation is wrong. You should be casting one pointer to another.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Try this ya
CCVector_3DDoc* pDoc =reinterpret_cast<CCVector_3DDoc*>(GetDocument());
VIBIN
"Fool's run away,where angle's fear to tread"
|
|
|
|
|
|
Please tell me CCVector_3DDoc is derived from CDocument before you go and use reinterpret_cast
everywhere to fix everything
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
hi,
I'm trying to redirect output of a command to a file
this command works fine in dos command line: ipconfig.exe /all > c:\\ipconfig.txt
In my program I do this way:
_execlp("ipconfig.exe","ipconfig.exe","/all",NULL); --> works fine
_execlp("ipconfig.exe","ipconfig.exe","/all",">","C:\\ipconfig.txt",NULL); ---> crash without a trace !!!
I don't know what is the problem here ?
|
|
|
|
|
Put ipconfig.exe /all > c:\ipconfig.txt in a batch file. and then run the batch file via CreateProcess() or ShellExecute() .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi all:
I want to measure strings from different languages and different fonts in a Win32 app, Is there any APIs that I can take advantage of, or do it from scratch?
Thanks.
|
|
|
|
|
Check out GetTextExtentPoint32()
|
|
|
|
|
Hi
<br />
char buf[10] = "old";<br />
char *c = "new";<br />
c = buf;
buf = c;
I can assign array name to pointer but i can not assign to array.
Why? Isn't array a pointer?
thanks
|
|
|
|
|
That is because buf is a pointer to a static array of length 10. If you want to initialize it, then use strcpy function.
Sisira
|
|
|
|
|
An array is not a pointer. However, in some cases, there is an automatic conversion from an array to a pointer to the first element of the array. In other words, this:
c = buf; actually does:
c = &buf[0];
|
|
|
|
|
It seems using the following scheme would cause problem while building in MS Visual Studio 2005. Can someone give any suggestion on HOW TO ACCESS MEMBER VARIABLE OF b IN a.cpp? Some preprocessor instructions would be appreciated. Thanks a lot.
class b;<br />
class a : public A<br />
{<br />
public:<br />
void SomeFunction();<br />
b* m_pb;<br />
};<br />
<br />
#include "a.h"<br />
#include "b.h"<br />
void a::SomeFunction()<br />
{<br />
MEMBERVARIABLEDATATYPE Member_Variable_of_b = m_pb->MemberVariable;
}<br />
<br />
class a;<br />
class b : public B<br />
{<br />
public:<br />
a* m_pa;<br />
MEMBERVARIABLEDATATYPE MemberVariable;<br />
};
|
|
|
|
|
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
|
|
|
|