|
Hi guys
When my App is running in W98 I receive sometimes a "Resource necessary non available".
There is a way to avoid this message in W98? Programatically? With an utility?
Best Regards
Doc
|
|
|
|
|
At the point in which the message is displayed, what resource is your application asking for (e.g., bitmap, icon, menu, dialog, string table)?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
In the dialog where the problem appears I'm using CLayeredBitmapCtrl (I get from CStatic controls) with a lot of layers.
Best Regards
Doc
|
|
|
|
|
I'm not familar with that class but perhaps you could ask its author why it would fail given the way you are using it.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi!.
I'm writing an application and I have to build configuration, for _DEBUG and for _DEBUG +_UNICODE.
In the programa I use many TRACE() and AfxMessageBox that show some text, the problem is that I must duplicate every line of code with these function because it must be one's with the macro _T() or L for _UNICODE and others without it.
For example:
<br />
#ifdef _UNICODE<br />
TRACE(L"Hello build with UNICODE support");<br />
#else<br />
TRACE("Hello build without UNICODE support");<br />
#endif<br />
<br />
There is other way to write this kind of stuff, without check the build configuration?.<br />
<br />
Thanks! <br />
<br />
Demian.
|
|
|
|
|
Why not a Macro that expand into this?
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Check out the _T() macro:
TRACE(_T("Hello build with UNICODE support"));
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi.
I'm using the marco _T() indeed.
The macro _T() wrapped L.
Demian.
|
|
|
|
|
Demian Panello wrote:
The macro _T() wrapped L.
Of course. And in the case where _UNICODE is not defined, _T() resolves to nothing. This will eliminate the need for all of the #ifdef directives.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi David.
You are right!
This is the solution, at least with TRACE() an others functions.
Thank you very much.
Demian.
|
|
|
|
|
corelibc.lib(pegwmain.obj) : error LNK2019: unresolved external symbol _WinMain referenced in function _WinMainCRTStartup
X86Dbg/image.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
i have this kind of error message but i dont have any clue ... i think something wrong with the emulator ? im using eVC 3.0 and i try eVC 4.0 sp3 but same result....
|
|
|
|
|
Just a guess - but it sounds like the project settings don't match reality - for instance, you have your project set up to build a Windows application, but you have coded a console application.
Sometimes I feel like I'm a USB printer in a parallel universe.
|
|
|
|
|
Someone know where I can find same examples look at Extending the WAB (windows address book) Context Menu Actions
Tanks in advice.
Matteo
|
|
|
|
|
Hello
I've got a vehicle class (cVehicle), and two 'heirs', car (cCar)and van (cVan). I store cars and vans in a list. The cvehicle class has a vehicle_type atribute (a char that is 'c' when it's a car and 'v' if it's a van). I want to take it out.
in the following code, i get a vehicle from a list. I don;t know if it's a car or it's a van. I use the vehicle_type atribute to see if it's a car, and if it is, i must return it.
<br />
cvehicle *vtemp=(list->Getvehicle());<br />
if (vtemp->get_vehicle_type()=='c')<br />
return vtemp;<br />
<br />
i've heard of a more elegant way to solve it, that is with the typeid operator. Do you know how to use it?
thanks!
|
|
|
|
|
do you know MSDN ?
i cite :
typeid Operator
C++ Specific —>
<code>typeid( type-id )
typeid( expression )</code>
The <code>typeid </code>operator allows the type of an object to be determined at run-time.
The result of a <code>typeid </code>expression is a <code>const type_info&</code>. The value is a reference to a <code>type_info </code>object that represents either the type-id or
the type of the expression, depending on which form of <code>typeid </code>is used.
See type_info Class for more information.
END C++ Specific
here you are
TOXCCT >>> GEII power
|
|
|
|
|
sorry, i'm new to c++ and i don't have msdn cds.
would you mind giving me an example of typeid usage, if it's not too much trouble?
|
|
|
|
|
string clss;
if (typeid(obj)==typeid(int)) clss = "I";
else if (typeid(obj)==typeid(unsigned int)) clss = "i";
else if (typeid(obj)==typeid(float)) clss = "F";
else if (typeid(obj)==typeid(double)) clss = "D";
else if (typeid(obj)==typeid(short)) clss = "B";
else if (typeid(obj)==typeid(unsigned short)) clss = "b";
else if (typeid(obj)==typeid(long)) clss = "I";
else if (typeid(obj)==typeid(unsigned long)) clss = "i";
got the idea?
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
i tried this but it doesn't work
cvehicle *vtemp=(list->Getvehicle());
if (typeid(vtemp)==typeid(ccar)))
return vtemp;
|
|
|
|
|
just tried this and it works
CString temp;
CString temp1;
const type_info& t = typeid(temp);
AfxMessageBox (t.name ()); // It gave class CString
if(typeid(temp1) == typeid(CString))
AfxMessageBox ("Matched"); // It said matched
Check this too:
class Base { ... };
class Derived : public Base { ... };
void f()
{
Derived* pd = new Derived;
Base* pb = pd;
...
const type_info& t = typeid(pb); // t holds pointer type_info
const type_info& t1 = typeid(*pb); // t1 holds Derived info
...
}
(This is your prob, you should dereference the pointer)
What does yours do?
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
t and t1 are always diferent!
from the debugger:
t: + _m_d_name 0x00433890 ".PAVcvehicle@@"
t1: + _m_d_name 0x00433850 ".?AVccar@@"
|
|
|
|
|
yes so check it against t1
dereference first the pointer you receive and then compare it to typeid(ccar)
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Papa wrote:
dereference first the pointer you receive and then compare it to typeid(ccar)
what do you mean by this?
sorry, english isn't my first language
|
|
|
|
|
cvehicle *vtemp=(list->Getvehicle());
if (typeid(*vtemp)==typeid(ccar)))
return vtemp;
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
it gives me an error: (runtime error, it builds alright)
unhandled exception
|
|
|
|
|
"If the expression is dereferencing a pointer, and that pointer’s value is zero, typeid throws a bad_typeid exception. If the pointer does not point to a valid object, a __non_rtti_object exception is thrown."
Do you have a NULL pointer?
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|