|
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
|
|
|
|
|
Ahuja Ekta wrote: 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...
Try WSAGetLastError to reterive actually what problem winsock is facing .
|
|
|
|
|
CCeSocket does not work well as a server. See, for example, "BUG: CCeSocket OnReceive() does not get called for accepted data sockets" at http://support.microsoft.com/default.aspx?scid=kb;en-us;253945[^]
It sounds like this might be your problem, and the above link gives a work-around. But the work-around involves modification to the MFC library header for Wcesock.h and sounds a bit nutty to me. Frankly, I would avoid use of CCeSocket in a server, and write my own from the basic Winsock API.
Best,
Mike
|
|
|
|
|
i am working on MFC with .net enviornment.i am using list control and it so many item items at run time and also show scroll bar as needed but when i shift the list controll column then these scroll bars are hide(not show) but i want thease scroll bar as needed but not hide when i shift the list control item.
so please told me where i am wrong.
Bankey Khandelwal
Software Engineer
|
|
|
|
|
Bankey Khandelwal wrote: MFC with .net enviornment
Do you mean VS2003 or VS2005 ? Or managed code ?
Bankey Khandelwal wrote: i shift the list controll column then these scroll bars are hi
What do you mean with "shift the list control column" ? In the resource editor of your list control, you should have a property that forces the scroll bars to be always drawn. Check there.
~RaGE();
|
|
|
|
|
i am doimg i project using c++ builder program and a matlab program...now i wanna want to combine the 2 output of project to do something...
assume that t is matlab output and f is c++ builder output
j=t*f;
if(j==1)
{
........
the problem is how can i compile matlab to c++ builder...i have look some explaination in matlab help but i want see some example so that i can understand clearly the process to do it...because now i so confuse with it...pls send to my e-mail leehf29@yahoo.com if you know about it...
thanks a lot.....
|
|
|
|
|
I honestly did not exactely understand what you meant, but search for 'matlab' on the search combobox up there anc check the result, it should help you...
~RaGE();
|
|
|
|
|
Using the resource Editor I create a menu and add text for the menu items. When adding the text I use the amperstand '&' to underline a char in the word eg '&Save'. The preview in the resource editor shows it correctly. But within the app only the word is visible and no underscore.
How do you do it?
|
|
|
|
|
waldermort wrote: But within the app only the word is visible and no underscore.
The new default is not to show keyboard accelerators. With the menu open, press the "alt" key to show the accelerators. There is a way to change the default behavior, I’m just drawing a blank, but is somewhere in the control panel.
|
|
|
|
|
Thanks for the quick reply. I have to laugh, I have been working on windows for so long I never noticed this behaviour with the menus, I can see it everywhere now.
|
|
|
|
|
actually, this happens not only by Alt but by keyboard selection...
take for example a dialog box, which opens another dialogBox.
if you navigate through the menu an click the item which opens the child dlg with the mouse only, then the controls in the child will not show the accelerators neither. but if you navigate using the keyboard (F10 or Alt to open menu), then the child dialog controls will show their accelerators...
can you see them ?!
|
|
|
|
|
Right-click the desktop and select Properties. Click the Appearance tab. Click the Effects button. Uncheck the "Hide underlined letters..." checkbox.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|