|
I have 2 tree controls and when i drag an item form one tree control to another, the tree control doesnot get refreshed.
what should i do to avoid that
Manickavasagam N
Software Engg. Consultant
ISRO Satellite Centre
Bangalore
|
|
|
|
|
did you try
m_tree.Invalidate(TRUE);
it works fine with me.
|
|
|
|
|
I created a very simple dialog box with OK, CANCEL buttons on the top right hand corner of the dialog box. When I maximise the dialog box,these two buttons appear in the center of the dialog box. How can they be automatically positioned on the top right-hand corner of the enlarged window?
I am a beginner. Kindly help me out.
Srini
|
|
|
|
|
1. You add control variables for the buttons.
2. You add a handler for the dialog WM_SIZE .
3. In this function, you test for the buttons being created (as WM_SIZE will be sent before the controls are created), for example so:
if( m_okButton.m_hWnd )
{
4. If the buttons are created, you use the x and y inparameters to place and/or size the buttons as desired. The buttons can be moved with MoveWindow or SetWindowPos (the last one taking more parameters, but it can move without resize, for example).
|
|
|
|
|
Handle the WM_SIZING message (OnSizing() in MFC) and MoveWindow() your buttons according to the top-right corner.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I need to monitor oracle server connection through run time and close the application as soon as the connection to oracle server is lost.
Any suggestion would be appreciated?
Please also let me know if you have a good idea for the monitoring than creating a thread?
|
|
|
|
|
What oracle client version do you have? if it is 9xx.. have you installed OO4O?
Jaime
|
|
|
|
|
I have some data acqusition software in pc, This pc is acquireing data, I want send this data to another pc through USB. How I can Access USB driver?, What are the driver files? If some sample programme is there kindly send to me.
Regards,
subbu
|
|
|
|
|
USB wasn't designed for that, so you cannot do it without extra hardware. Best is to put an ethernet or 802.11 adaptor on USB, and use standard ip/sockets to comunicate.
Some companies make (or used to make) adaptors that would also do this. However I'm not sure extactly how they work, so I can't be sure they will provide you an interface to send data.
There is socket examples all over the internet, search them out.
|
|
|
|
|
hi,
I want to create only one instance of my application ,,
that only one instance run at a time on one PC.
any help or code plz
thanx
|
|
|
|
|
put a named mutex into the startup function...
|
|
|
|
|
How can i use Mutex ..
Plz send code example i not know abut it
thanx
|
|
|
|
|
Try CSingleInstance[^] by PJ Naughter.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fuity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
|
Another example can be found here.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi All,
I have small doubt about Critical Section. Is there is any specific reason for using Critical Section object as a class member. why don't declare global Critical Section object and it will be used for lock & unlock in multithreading application.
for example
Class Test
{
public:
int x,y,z;
int function();
private:
CRITICAL_SECTION cs;
};
for locking & unlocking we are using cs in Multi Thread program.
instead of that
CRITICAL_SECTION cs; //global for all object....
Class Test
{
public:
int x,y,z;
int function();
};
now cs activing as global object which will be used for locking & unlocking.
whether about code is correct or not ?. is it works in multithreading application.
Please clarify the above doubt.
Thanks,
Regards,
Prem.
|
|
|
|
|
If you have multiple instances of class Test which I assume you do otherwise you wouldn't need a critical secion then the critical section must be either a static inside the class or a global. ie. All instances of the class must see the same instance of the critical section. IMO it is better in the class as I don't like things polluting the global space.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
It depends what you are trying to control access to.
With the critical section as a private member, as in the first example, it can be used to synchronize access to the members/methods of that instance without affecting other instances of the same class.
|
|
|
|
|
Mike Beckerleg wrote:
With the critical section as a private member, as in the first example, it can be used to synchronize access to the members/methods of that instance without affecting other instances of the same class.
Yes, I didn't think of that.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
It's a design decison, it depends how finely you want to control your locking. In principle each resource should have a CS (or other synchronisation). So in your class Test it's appropriate to have a CS in each instance of the class since the resources being protected (function and x, y, z) are unique to each instance of the class.
But be careful about copying classes that contain CRITICAL_SECTIONS, I think each instance needs a new one, not a copy of an old one, so you need to write copy constructors etc. I suggest a helper class.
Paul
|
|
|
|
|
Thanks for your valuable suggestions. If any material available for how to use synchronisation object and various design methods etc....Please help me.
Once again Thanks for your comments...
Regards,
Prem
|
|
|
|
|
Has anyone got the IElementBehaviorLayout inteface to be executed properly. I have created a simple behavior which needs to draw itself and therefore needs to specify its size to the IE layout engine. The GetLayoutInfo() method is called but no other unless I set the width/height in style. I can set them to 0, any value will do. It also works by setting position to absolute but I don't want this. Setting the style values programatically in the behavior init method also works. None of the MS samples show usage of the IElementBehaviorLayout interface.
If anyone has any clues I would be most grateful
Andy H
|
|
|
|
|
I have a simple question about static member variables in C++: when are the static member variables created/initialized? When the first instance of the class is instantiated, or when the program starts? If class A is defined in another file, can I immediately access a static member variable called m_SomeInt using A::m_someInt immediately at the beginning of my program, when no instance of class A is created yet? (assuming m_someInt is a public member)
Thanks!
|
|
|
|
|
For the static member to exist, it is not necessary that any objects of the class type exist.
See Static Data Members[^]
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fuity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
I associate rtf files with my app.I want to add the same property sheet that Microsoft has implemented for Word when you right click on a doc file and appears a property sheet called Summary.How can I do this?Thanks a lot.
|
|
|
|