|
Synchronization object used is Critical section and priority of all the threads is Normal.
There is no looping. I have removed all the infinite loops.
Well to communicate with the main thread i am using SendMessage and not PostMessage. Is this the culprit???
As it is recommended to use PostMessage. I have to pass some structure and if i use PostMessage then that sturcture passed to the PostMessage function goes out of scope. So i have to use SendMessage for that. If there is any other alternative to achieve this.
|
|
|
|
|
samhita wrote:
SendMessage and not PostMessage. Is this the culprit???
Sure it is - You can't SendMessage from a thread (as you have seen demonstrated )
samhita wrote:
[...]that sturcture passed to the PostMessage function goes out of scope.
Construct that structure on the heap (new ...). (Your whole process with all threads shares one memory space)
Then send the address of that struct with PostMessage and do not delete it in your calling function. With the call to PostMessage , you transfer the ownership to your message handler.
After use (in your message-handler), you call delete on the struct, so as not to leak memory.
Hope this helps
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
|
Michael Dunn wrote:
[Sendmessage from a thread]
But then you have to do a lot of synchronisation yourself.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
after execute an app by CreateProcess() function, we can establish communication pipe between the app and its owner (another app).
the owner, in some way, is a "command window".
now i want to use shared memory between the 2 apps.
the Q comes from java jdb.exe (an app).
when i use dos command window to execute jdb.exe, they communicate properly.
but when i use my app to execute jdb.exe, they can't communicate each other.
the reason is that the commanication must be on shared memory, not pipe (ip is possible OK but not in our case).
do you have any idea that how dos command window use sheared memory or how an user app use shared memory whth other apps?
thanks in advance.
includeh10
|
|
|
|
|
|
Hi, can u please tell me how to remove icon from header in CListCtrl ?
Thanks.
|
|
|
|
|
hi,
IN LVCOLUMN structure, give blank image id.
This should work.
Chill
Anand
The chosen One
|
|
|
|
|
Thx but text is not formated right , there is a space between text and border
|
|
|
|
|
What space u c is not space it is blank image.
Live with it if possible
The chosen One
|
|
|
|
|
hi,
for my application backend is mysql. for crystal report i need to create ODBC dsn on run time. any one help to me.
thanks in advance.
|
|
|
|
|
How do i get the mapped drive information?
Suppose I map a folder Shared of machine A to drive h then how to get the mapped drive information like which folder is mapped to this drive.
Suvarna
|
|
|
|
|
Check out WNetGetConnection() .
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I am setting font to menu items. For this i have set the onwerdraw property to true and implemented DrawItem.
In WndProc Procedure the lparam parameter is type cast to Drawitemstruct. This has one field as itemId which specifies the menu item id.
In windos 2000 i am not able to get this item id correctly, if the menu item has a submenu. for example if my menu is like
File Edit Search
|-------Open |-----Find
|-------New |-----Find Next
|------Close
Then it does not give itemid of file properly, some big value is assigned to itemid which is not correct. Similarly i am not getting itemid of search as well. For rest of the items Open, New, Close,Edit, Find and Find Next i am getting the correct item id and i am able to change its font and font size.
This concludes that if any menuitem has a submenu then its item id is not assigned properly. Also this happens in Winows 2000 only and in Windows 98 it shows properly. Can anybody please tell me why it is not assigning correct itemid?
Suvarna Joshi
|
|
|
|
|
How do I Change the font for text in controls . like a CStatic or CButton Object ?
|
|
|
|
|
::SendMessage(hWndStatic, WM_SETFONT, (WPARAM)hFont, (LPARAM)TRUE);
--
Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. (Douglas Adams)
|
|
|
|
|
I am running a Dialog app that creates a ProperySheet .
1)The sizes and positioning in one screen resolution seems totally ugly in the other . How do i make all positioning independent of the Windows screen settings ! Please help
2) I want my PropertySheet window never to be closed ! How to do this ?
3) I want to disable one of the tabs of my PropertySheet at runtime ! How do I do this ?
act_x
I have lost the race of finding a Software job in the US ! I am outta here!
|
|
|
|
|
hi,
1) use GetSystemMetrics to get the screen resolution without depending on which resolution you are in, then set the size to be a ratio from the screen width and height
2) override OnApply and just return
3) override OnSetActive for the property page u want to disable...
hope i helped ya
Yaron
|
|
|
|
|
Interesting.
Post the code the sends messages from the worker thread to the main thread.
Kuphryn
|
|
|
|
|
What i have now is an MFC application,that doesn't use
Document/View,and will render Full-Screen using D3D9 without any problems(Flickering etc).
When i try the same in an standard SDI application that does use the Doc/View,(View being where D3D is set up)the device fails.
If there are any members here(more experienced on the MFC side of things) that is willing to have a go,and work with me to get this working,please let me know,and i can e-mail you the code i have now.
I think this would be a very useful piece of code(or tutorial)especially for certain game programmers wanting to take advantage of some of the features of MFC,such as serialization or want to program games(Full-Screen)using MFC.
using the major search engines,i haven't found any information/examples on the net discussing or showing the setup or how to get the latest version(or even v8.0/8.1) of D3D running (Fullscreen) with a SDI MFC application.
If i get some interest/help with this,i may contribute to the site on some more advanced DX game programming subjects,for MFC,that can be built upon/extended from this base framework i am trying to build now.
Appreciate your help/answers.
|
|
|
|
|
There are any number of DirectX / MFC integration samples around. Google for 'DirectX' 'MFC' or look thru http://www.flipcode.com/ or http://www.gdmag.com/homepage.htm
They are all quite naive but they work. If you want to go beyond them you need to override CWinApp::Run() in your application and using a HighPerformance timer to trigger rendering threads attached to all you 3d views (at your desired frame rate).
Now that they have changed the architecture again in dx9. You would have to use the IDirect3DDevice9::CreateAdditionalSwapChain to create additional back buffers for each view etc etc
The basic issue for SDI / Fullscreen swapping is that you will need to destroy and recreate the device when changing between them.
|
|
|
|
|
Would it be possible for you to give me the url to one of these full-screen examples using Doc/View?
I did find some (google)that are not full-screen(i already have it full-screen,but not using the doc/view setup).
I could only find a message on the forum at www.flipcode.com where there was another guy,having the same problems as i'm having,in Full-screen mode.
There was no replies to his post though.
I don't need a 4-view(or multiple views)i already have an editor built in MFC(4-View)which runs in windowed mode.
I only need an example/help with getting a SDI application,with Document/View architecture,to run in Fullscreen mode with D3D.
Thanks for your help.
|
|
|
|
|
Hello.
I am having trouble using a template function with a return type of an enum as a friend of a non-templayte class. When I use the code sample (below), I get:
"error C2440: 'initializing' : cannot convert from 'void' to 'enum ENS' Expressions of type void cannot be converted to other types"
I am using Microsoft Visual C++ 6.0 Professional Edition. If anyone can shed some light on this, I would really appreciate it.
//=============================================
enum ENS {
ENS1,
ENS2,
ENS3
};
class A;
template <class T>
ENS f(T, A *a) {
a->x;
return(ENS1);
}
class A {
private:
int x;
template <class T>
friend ENS f(T, A *a);
};
//=============================================
int main(int argc, char* argv[]) {
A a;
int i = 4;
ENS e = f<int>(i, &a); //this line generates
// the c2440 error
return(0);
}
|
|
|
|
|
|
Perhaps that's all I needed, but it is kind of weird, though.
Thank you
--Ziro--
|
|
|
|