|
That's not a function template, that's a member function template.
Yes, VC6 have serious problems and bugs when it comes to template handling. One of them is IIRC that member function templates must be both declared and defined within the class declaration.
One could argue that it's about time ObjectStore fixed their library to allow standard C++ operations (begin(), end(), assignment, ...), but I digress.
|
|
|
|
|
Yup, solved the problem by taking it out of the class. And i have to explicit specify the type when making the call. Thanks guys
|
|
|
|
|
Sir, I want to create bitmap which must uses 1 bytes per pixel using CreateBitmap() API function. But I am very much confused and I don't get success in setting up of 5th parameter. Would you please help me regarding this........If there is any sample program, please send.
C.R.Naik
|
|
|
|
|
The CreateBitmap function creates a device-dependent bitmap.
Try CreateDIBSection.
|
|
|
|
|
Hey!
After writing a C++ application , what are the steps to release it and get the .exe file?
Thank u.
Bebe Harhour
|
|
|
|
|
To get the release version, go to build, set active configuration. The dialog that comes up allows you to set your project configuration. Set it for Win32 Release. Rebuild your program. VC++ should make a new folder in your program directory called Release. This is where your executable is. Hope this helps.
Brad Jennings
|
|
|
|
|
Hi,
I inserted a class into a new DLL win32_DLL project and got following debug result:
<br />
<small> --------------------Configuration: HydroDLL - Win32 Debug--------------------<br />
Compiling...<br />
CommMonitor.cpp<br />
C:\Program Files\Microsoft Visual Studio\MyProjects\HydroDLL\CommMonitor.cpp(34) : error C2065: 'TRACE' : undeclared identifier<br />
C:\Program Files\Microsoft Visual Studio\MyProjects\HydroDLL\CommMonitor.cpp(34) : error C2065: '_T' : undeclared identifier<br />
C:\Program Files\Microsoft Visual Studio\MyProjects\HydroDLL\CommMonitor.cpp(80) : error C2065: 'CString' : undeclared identifier<br />
C:\Program Files\Microsoft Visual Studio\MyProjects\HydroDLL\CommMonitor.cpp(80) : error C2146: syntax error : missing ';' before identifier 'strPort'<br />
C:\Program Files\Microsoft Visual Studio\MyProjects\HydroDLL\CommMonitor.cpp(80) : error C2065: 'strPort' : undeclared identifier<br />
C:\Program Files\Microsoft Visual Studio\MyProjects\HydroDLL\CommMonitor.cpp(83) : error C2440: '=' : cannot convert from 'char [11]' to 'int'<br />
This conversion requires a reinterpret_cast, a C-style cast or function-style cast<br />
C:\Program Files\Microsoft Visual Studio\MyProjects\HydroDLL\CommMonitor.cpp(87) : error C2228: left of '.Format' must have class/struct/union type<br />
C:\Program Files\Microsoft Visual Studio\MyProjects\HydroDLL\CommMonitor.cpp(263) : error C2065: 'ASSERT' : undeclared identifier<br />
C:\Program Files\Microsoft Visual Studio\MyProjects\HydroDLL\CommMonitor.cpp(435) : error C2065: 'AfxMessageBox' : undeclared identifier<br />
HydroDLL.cpp<br />
Generating Code...<br />
Error executing cl.exe.<br />
<br />
HydroDLL.dll - 9 error(s), 0 warning(s)
My question is : I guess I forgot the header file, could u tell me what's that
Thx
Extreme programming. Do the No.1
|
|
|
|
|
|
Hi,
Thank u.
The answer is, I should use Appwizard DLL instead of Win32 DLL. and one more thing, manually add header file and app file to create a new class instead of using pop menu.
Extreme programming. Do the No.1
|
|
|
|
|
Hi! I have a question about the mfc programming on a PocketPC with only 256 colors!
I have to make a application on a PocketPC, the application should draw some things in his view! So I use the GDI functions with the RGB(r,g,b) macro, it works fine in the x86 emulator. But does it run on a PocketPC with only 256 colors? (I found a very cheap PocketPC - HP Jornada 525
- with WinCE 3.0, but only with 256 colors) Does the System (WinCE) convert (reduce) the colors (RGB) to 256 colors? Have anyone experience with PocketPC's and 256 colors?
--
Nice greets, Daniel.
|
|
|
|
|
It is not working for me.how to make my window background as blue color.i used
window.hbrbackground=(HBRUSH)RGB(0,0,255);
|
|
|
|
|
When casting to a (HBRUSH) you must either pass a handle to an actual HBRUSH, or mandatorily pass one of the known system COLOR_ symbols, such like COLOR_WINDOW.
In your case, you need a user color, so you must create a HBRUSH.
window.hbrbackground=(HBRUSH) ::CreateSolidBrush( RGB(0,0,255) );
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
Somebody help me!
I need to implement HTML Syntax hilighting in application, which written in pure API. Are there exist the ready solutions?
Thanks!
|
|
|
|
|
Hi,
you might try out www.scintilla.org[^] or the codemax [^] editor. Both very good text editors. The development for codemax has actually stopped but the source is still available i believe.
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
|
Both these projects too large. I need fast & small HTML viewer, not an editor... May be something else?
|
|
|
|
|
Thanks!!!!!!!!!! Scintella is EXACTLY THAT I looking for!!!!
|
|
|
|
|
I'm having a problem adding a node to a XML file. I am able to open the file and read the elements but when i try to add a node is bombs.
MSXML::IXMLDOMElement * node;
node = document->createElement("Test");
document->appendChild(node);
It doesn't like the append to child. What is the correct way to add a new node in a XML docuement?
Thanks
Scott
|
|
|
|
|
try this instead:
<br />
MSXML::IXMLDOMElementPtr node;<br />
node = document->createElement("Test");<br />
document->appendChild(node);<br />
This way you will use the smart pointer classes that make querying and managing interfaces a lot simpler. You will also need to use the #inport statement to load teh MSXML library and provide thses smart pointers for you.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
What do i need to import i currently have
#import "msxml.dll" named_guids
Scott
|
|
|
|
|
That's what you need.
Try the smart pointer implementation that I mentioned.
If that does not work then make sure that you have a valid document created.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
|
Have you tried reading the error response codes to see why it bombs?
It would also be useful to see the code that you are using starting with where your Document is created.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Heres the code
String strPathName;
strPathName = "C:\\My Documents\\C_Projects\\XML\\books.xml";
CString csString;
HRESULT hr;
hr = CoInitialize(NULL);
if (FAILED(hr)) {
return;
}
hr = CoCreateInstance(MSXML::CLSID_DOMDocument, NULL,
CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER,
MSXML::IID_IXMLDOMDocument, (LPVOID*)&document);
if (!document)
{
return;
}
BSTR bstr = NULL;
document->put_async(VARIANT_FALSE);
bstr = strPathName.AllocSysString();
VARIANT_BOOL varOkay = document->load(bstr);
SysFreeString(bstr);
BSTR nodeName;
if (varOkay)
{
hr = document->get_documentElement(&element);
if (FAILED(hr) || element == NULL)
{
MessageBox(_T("Empty document!"), _T("Error Loading XML"), MB_ICONWARNING);
return ;
}
element->get_nodeName(&nodeName);
m_List.AddString(CString(nodeName));
if(element->hasChildNodes())
{
MSXML::IXMLDOMNode* firstChild = NULL;
HRESULT hr;
hr = element->get_firstChild(&firstChild);
if (SUCCEEDED(hr) && firstChild != NULL)
{
((MSXML::IXMLDOMElement*)firstChild)->get_nodeName(&nodeName);
m_List.AddString(CString(nodeName));
}
}
MSXML::IXMLDOMElementPtr node;
node = document->createElement("Test");
document->appendChild(node);
}
else
{
long line, linePos;
BSTR reason = NULL;
document->get_parseError(&parseError);
parseError->get_errorCode(&hr);
parseError->get_line(&line);
parseError->get_linepos(&linePos);
parseError->get_reason(&reason);
CString strMsg;
strMsg.Format(_T("Error 0x%.8X on line %d, position %d\r\nReason: %s"),
hr, line, linePos, CString(reason));
MessageBox(strMsg, _T("Error Loading XML"), MB_ICONWARNING);
SysFreeString(reason);
return;
}
on the line -- document->appendChild(node);
is gives the error
Unhandled exception in XML.exe(kernal32.dll); 0xEO6D7363; Microsoft C++ Exception
Scott
|
|
|
|
|
Try appending your newly created node to the "element" or root nod eof your document rather than your document. I beleive your problem is that there is already a root element in the document and that is why there is a problem. However appending your new node ot the root element of the document seems to work fine.
If you have any other questions feel free to ask.
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|