|
Modeless dialogs should do the trick. Store your dialog as a member variable, and then call ( from memory ) Create instead od DoModal, and ShowWindow. I use pointers, and do this in the dialogs constructor
if (Create(IDD, pParent)) ShowWindow(SW_SHOW);
That's from memory, but it's something like that.
Of course if you use pointers, make sure to set them to NULL when you delete them, and call DestroyWindow on them first. Or just call ShowWindow(SW_HIDE); to hide them. I use ::IsWindowVisible((m_pDialog); to see if a window exists and is visible.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
But better style were views.
|
|
|
|
|
i have two views in the program one uses the treeview and the second uses a listview now each item in the list view should be opened in a seperated window.
this is what i was asking i might open moore than one item from the list how can i do this.
thanks,
Best Regards,
Zakarni
|
|
|
|
|
Hello Friends,
I have a very intresting question .
The problem is that i have written an application(.exe) it uses a .dll file i.e few functionality are provided in the dll file . as the file is used it is loaded dynamically now the problem is that i want to change this dll without unloading the application is this possible??? i have done some changes in the dll so without unloading the application can i unload the dll and again reload it. but as the dll is loaded it is not replaced by the new dll in that folder .
can any one suggest me a option for it????
Tryout are also welcome.Please suggest some technique to do this
|
|
|
|
|
If you close the dll, you can replace it. So long as the code is using the dll ( i.e. has it open ), you can't.
Or am I misunderstanding you ? You have the dll and just want to swap them without turning your main app off, right ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
actually u got the point right i have to change the dll and not swap.see i have a folder called ABC in this abc folder i am having my application app.exe and all called xyz.dll.
now my applixcation app.exe is running and it is using the xyz.dll.so the xyz.dll is loaded .Now i want to replace this xyz.dll in the folder and that loaded in the application i.e is app.exe. is it possible???
thanks for prompt reply
|
|
|
|
|
FreeLibrary() is the opposite of LoadLibrary(). But it doesn't guarantee that the dll will be unloaded and unlocked.
Signature space for rent. Apply by email to....
|
|
|
|
|
i have to change the dll .see i have a folder called ABC in this abc folder i am having my application app.exe and all called xyz.dll.
now my applixcation app.exe is running and it is using the xyz.dll.so the xyz.dll is loaded .Now i want to replace this xyz.dll in the folder and that loaded in the application i.e is app.exe. is it possible???
yep freelibrary() is possible but i will have to stop the work done by the dll function for that tiome??? how to move ahed
|
|
|
|
|
hi,
in one procedure I post message to thread with wParam , the thread accepted my message, but wParam is corrupted.
Here is the code:
In the procedure
MsgParam *pSendParam=new MsgParam;
pSendParam->pBuf=pBuf;
pSendParam->nLen=nLen;
PostThreadMessage(tid,WM_HYDRO_RXD_ARRIVAL,(WPARAM)pSendParam,0);
In thread Function
case WM_HYDRO_RXD_ARRIVAL:
pRecParam=(MsgParam*)msg.wParam;
before PostThreadMessage , pSendParam is correct(in this case, it's f5f5090574a05200 ), but in case WM_HYDRO_RXD_ARRIVAL , the value is corrupted as 44bf4a5f01000000 ,
How to transfer data correctly?
Extreme programming. Do the No.1
|
|
|
|
|
appreciation for any information on this post.
Thanks
Extreme programming. Do the No.1
|
|
|
|
|
BTW: Your E-Mail address seems to be incorrect. I got an "Undeliverable Mail" message for steven_wng@sina.com on my previous post. Hope you check the forum as well
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
You are developing on Win64? Wow
Your problem sounds a bit strange. It should work as you described, I can't find anything conspicuous in your code. I would suppose a subtle side effect:
- Are you sure the value of WM_HYDRO_RXD_ARRIVAL is unique and you are not accidently catching the wrong message?
- Are you sure _W64 is always defined and really all data types are used as 64 bit types?
- Did you monitor any other side effects that look like memory corruption occuring somewhere in your app?
- Does the same problem appear in a small test app?
(Hm the above looks a bit like the generic "are you sure the power cable is plugged in" hotline answer )
Good luck!
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
the code is absolutely incorrect.
try to send an int
int i=5;
PostThreadMessage(tid,WM_HYDRO_RXD_ARRIVAL,(WPARAM)i,0);
it will be OK.
when u pass an object created by new, normally it can not be passed to another thread in the simple way.
i don't know how to do it, but i did similar thing in COM, if u know COM, try same idea that how COM passes object to another COM (they are in 2 threads).
good luck.
includeh10
|
|
|
|
|
What?
Sorry, includeh10, but you seem to completly misunderstood the concept of threads.
You can pass pointers between threads as long as you make sure they reside in the same process. All threads inside a process share the same address space, therefore any address reference is valid and accessable by every thread. Actually this easiness of inter-thread communication is the main reason we use threads instead of processes.
COM puts a lot of "magic stuff" (like apartments, free threaded marshaller, ...) around this, because it has to guarantee that it even works if both thread reside in different processes or even on different machines.
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
i am pretty sure that an object can be past from one COM to another even 2 COM are in the same process (or create by same process).
as i said, i never use threads in this way, but i don't think the code would work.
anyway, do further test to get right answer.
good luck
includeh10
|
|
|
|
|
hi,
yeath, I really can pass int i through the gap,but can't pass a struct. I don't know why too. As far as COM is concerned, Inside COM and Essential COM is all what I have. I determined to check it out.
Thanks
Extreme programming. Do the No.1
|
|
|
|
|
Have you tried passing pSendParam through the LPARAM parameter?
PostThreadMessage(tid,WM_HYDRO_RXD_ARRIVAL,0,(LPARAM)pSendParam);
and changing your thread to this:
pRecParam=(MsgParam*)msg.lParam;
Kelly Herald
Software Developer
Micronpc, LLC
|
|
|
|
|
Hi
I'm working on drawing a custom button (its quiet complex as its not really a button)..
is there anyway to remove the flicker as the button is redrawn.. I guess you create a new bitmap or something draw to that and copy it over all when its drawn..
can anybody give me an idea about what function to call to make a chunk of memory (or bitmap) that I can get the DC off and then draw to it..
I'm not using MFC
Many thanks..
Chris
|
|
|
|
|
The best thing is to handle WM_ERASEBKGND and there draw a bitmap that you store internally onto the HDC. Do all your drawing to the bitmap, and only do one BitBlt to the button, on that message handler.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
There are samples in the MFC MSDN. You can there evaluate the principles.
I would do all drawing in a memory dc and if ready draw all to the screen.
|
|
|
|
|
Does anybody know, how to use IE WebBrowser component in my application which would not use default IE http proxy server settings, byt will have it's own ?
Thanks
rrrado
|
|
|
|
|
Yes, if it's MSIE 5.0+. Search for INTERNET_PER_CONN_OPTION in MSDN.
Back to real work : D-23.
|
|
|
|
|
That seems to be only for querying/settiong options for different connections - like modem/lan. Not for different instances of IE. It operates with HINTERNET handle, it is lowest layer in web browser model. How to get/set HINTERNET handle for downloading on my IWebBrowser2 instance ???
rrrado
|
|
|
|
|
I'm doing a project using DirectDraw in 16 bit mode, and I stored a certain bitmap in a DD surface. Now I'd like to read the colors off the surface, process them accordingly and then assign the new values.
The problem is that the color is stored as an unsigned integer (for example "65503" for a shade of white). In order to process it I would like to break it back into 16-Bit RGB values (such as RGB16BIT(31,31,31), again for a shade of white).
How could I do so? anybody?
Isaac Sasson,
Small time programmer - complainer at large!
Sonork ID 100.13704
|
|
|
|
|
Surfaces use bit masking to express how the color components are stored. When you lock a surface in order to access it, you can pass a DDSURFACEDESC structure along and ask it be filled with the color masks, which is done with code like this :
DDSURFACEDESC ddsd;
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags= DDSD_LPSURFACE | DDSD_PIXELFORMAT;
HRESULT hr = pDDSurface->Lock(NULL,&ddsd,DDLOCK_SURFACEMEMORYPTR|DDLOCK_WAIT,NULL);
if (SUCCEEDED(hr))
{
DWORD redmask = ddsd.ddpfPixelFormat.dwRBitMask;
...
...
}
Now that you've got the bit masking, you can use logical shifts to break the actual bits into what you want. The point here is to know you can't hardcode the shifts, you must execute code according to the bit masking.
All of this should be obvious to anyone reading the DirectDraw reference doc.
Back to real work : D-23.
|
|
|
|