|
v2.0 wrote: ps: you've been asking so many easy questions these days, that i wonder if you are OK with C++... maybe you should learn for it a bit more deeper
Hey I'm sorry if my questions are too easy for you. Maybe if I made them a bit more difficult you would actually answer some of them. Perhaps I should take my easy questions over to the easy C++ message board.
|
|
|
|
|
not what i said... ;P
you are always welcome to ask C++ questions on the C++ forum
but if you're new to it, or need more subtle needs of the language, then you should look at a technical book or something (my favorite, The C++ language form Bjarne Stroustrup - but ok, i know it's not that easy to start with for newbies)
now, you can answer my previous questions :->
|
|
|
|
|
v2.0 wrote: ps: you've been asking so many easy questions these days, that i wonder if you are OK with C++... maybe you should learn for it a bit more deeper
Diplomacy is my first name
~RaGE();
|
|
|
|
|
Rage wrote: Diplomacy is my first name
ok, since then, i'll have to name you "Diplomacy" then
|
|
|
|
|
v2.0 wrote: i'll have to name you "Diplomacy" then
What about Diplomat
|
|
|
|
|
He said "Diplomacy", so...
|
|
|
|
|
v2.0 wrote: v2.0
you changed you name, Why?
|
|
|
|
|
shhhh
i'm incognito brother
i'll be back on May 2nd
|
|
|
|
|
I've had reasonable luck in VC6 with auto-complete for std template container declarations by wrapping them as trivial classes.
Example:
<br />
class CStdVector_BYTE : public std::vector< BYTE ><br />
{<br />
};<br />
<br />
class CMyClass<br />
{<br />
CStdVector_BYTE m_vecBytes;<br />
};<br />
Regards,
Dan
Remember kids, we're trained professionals. Don't try this at home!
|
|
|
|
|
From what I remember of typical compiler behaviour, include files are inserted into the main file at compile time. If you want the IDE editor to understand structures and such, they have to be in the main file.
I suggest you move the declaration of the vector to the main source file while you are doing the serious code-writing, and once the program is more-or-less finished, move the declaration to the header file? If you use the header in various places, you may need to use IFNDEF, etc.
|
|
|
|
|
I hope someone can help with this...
I am trying to select a bitmap into a device context. When I do this by creating a handle to the bitmap as follows everything works fine
*pm_hBmpNew = (HBITMAP) LoadImage(AfxGetInstanceHandle(), // handle to instance
filename, IMAGE_BITMAP, // image types
0, // desired width
0, // desired height
LR_LOADFROMFILE);
And then later on I select the object by doing
VERIFY(*pm_hBmpOld = (HBITMAP)SelectObject(*pm_dcMem, *pm_hBmpNew));
HOWEVER if I create that handle by creating a bitmap by calling CBitmap::CreateBitmap like so
p_cbmME->CreateBitmap(256,256,1,32,imagedata);
*pm_hBmpNew=((HBITMAP)*p_cbmME);
and then Select the object like before
VERIFY(*pm_hBmpOld = (HBITMAP)SelectObject(*pm_dcMem, *pm_hBmpNew));
then it works if I select a file(and create imagedata by reading in the file) the first time. But if I then press the same button again and select then another file without closing the application the application just hangs!
Also, I don't know if this is relevant but I am calling this function with two different buttons. And if I first call it with Button1 and then with Button 2 there is no problem. But if I then again press either of the buttons the application just stalls.
Can anyone help with this? Also is there any reason why AfxMessageBoxes should not work in my application? I am happy to explain my problem further, but just did not wanna put people off with long code if it is not necessary. I hope I explained my problem ok. Please someone help!
|
|
|
|
|
Hi Laughing Buddha ,
You wrote then it works if I select a file the first time. But if I then press the same button ...
I guess that your problem is p_cbmME->CreateBitmap(256,256,1,32,imagedata); I think that you need
to detach first HBITMAP from CBitmap and again use createbitmap
maybe it is some helpful to you
|
|
|
|
|
Oh maybe that is it although why does the handle work fine when I use LoadImage instead? If I just use Detach() then i get a microsoft error right away when I press the button because I assume then the handle to the temporary handle is deleted as well.
|
|
|
|
|
Laughing Buddha
I think if you create or attach a bmp file to CBitmap you need to detach bitmap but I suggestion that you detach previous variable Cbitmap,and if you use LoadImage I think DeleteObject(yourvariablegdi)
use Detach if you use attach or create to CBitmap
maybe it is some helpful to you
|
|
|
|
|
I think it is because you are not (closing the handles?) deleting etc the object. I think if you Create a graphical object like a bitmap, you should delete it also before reusing it. DeleteObject(...) should help with that.
I did not check your code thoroughly though.
this is this.
|
|
|
|
|
I do delete the objects like so at the beginning of the function:
if(pm_hBmpNew != NULL )
DeleteObject(*pm_hBmpNew);
if(p_cbmME !=NULL)
DeleteObject(*p_cbmME);
if(pm_hBmpOld != NULL)
DeleteObject(*pm_hBmpOld);
if(imagedata != NULL)
DeleteObject(imagedata);
if (prectStaticClient !=NULL)
DeleteObject(*prectStaticClient);
if (pm_st !=NULL)
DeleteObject(*pm_st);
but it is still not working. Am just deleting all of the ones that could possibly be involved but just not working. Could it be anything else? How would I go about detaching the bitmap from the CBitmap? Thank you for all your help so far
|
|
|
|
|
Oh my dear god I just finally found that detach handle and
IIIIITTTT WWOOOOOORRRKKKKKSSSSSS!!!!!!!!!!!!!!!!!!!!!!!
Oh thank you both so much, you don't believe how long I was working on this and just did not know that. Oh thank you! Thank you! Thank you!
|
|
|
|
|
hi all
i had made applicaton that generate the barcode and now i want the to make it as com component and acces through site. i mean online barcode geneator. it works fine as destop application.
i want to know how to use mfc classes in atl. or these allowed or cannot use these classes in atl 7. im using visual studio.net 2003. and atl 7 project.
Tasleem Arif
|
|
|
|
|
Yes, I think you can. It is just a COM dll using MFC. But in the project options, there is this option of "Attributes". Just uncheck it, now you could select MFC also. If you don't specifically include similar ATL header files, (like for CString, which is available in both MFC and ATL), it is all ok. I never had a problem with using both of them in one project (although I only used VC6).
this is this.
|
|
|
|
|
thanks for reply i will try that
ddd
|
|
|
|
|
Hello,
I am currently converting my win32 application into a .rtss based RTX application. However, my application requires a .dll file which for some reason cannot be opened by my .rtss application. Is there something i must do for my .rtss application for it to be able to open .dll files ?
|
|
|
|
|
Hi!
I found the following explanation to a subroutine. The subroutine gets 2 values, the second one is optionally set to zero or to an result. When it is set to zero, I have to write :
Export((_bstr_t)name, (VARIANT *)NULL);
But what kind of typecast do I have to do, if I will use as a first and second parameter a _bstr_t or CString-Type in the RESULT-array? I tried some things, but nothing worked.
Explanation from help file:
Sub Export( ByVal PathOrFilename As String,Optional ByRef Result As Variant )
Result is an array containing four string items, 1st is the complete filename or empty 2nd item is the complete navigation filename or empty 3rd item is the complete meteo filename or empty 4th item is the complete tilt filename or empty.
Thanks a lot, Hanno
-- modified at 4:23 Tuesday 28th March, 2006
|
|
|
|
|
hanno25 wrote: Sub Export( ByVal PathOrFilename As String,Optional ByRef Result As Variant )
This is VB so I don't really see what you are trying to do. You know that you are on a C++ forum ?
|
|
|
|
|
Yes, I know that. The help-file only gives informations in VB.
I have to use the supplied COM-interfaces in C++.
Below, there is the information from the precompiled header file:
inline HRESULT xxx::ICoClass::Export ( _bstr_t PathOrFilename, VARIANT * Result ) {
HRESULT _hr = raw_Export(PathOrFilename, Result);
if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
return _hr;
}
But that doesn't gives informations, that the result-Parameter has to be handled as a array, that's why I copied the VB-code in the first text.
Hanno
|
|
|
|
|
hi
im implemnting client server communication(TCP/IP) with the use of CCesocket functions.
currently im running the application on an emulator.
the application works fine till the point of ONACeept() function..
there are certain problems when the OnReceive function of server has to run.
the server does not receive data sent by client whereas the client does accept the data from the server...
can someone please help.......
Ekta Ahuja
ahuja.ekta@gmail.com
|
|
|
|