|
Thanks...
I have considered the idea of hiding, but it may not be suitable for this problem since the combo box will have a lot of types that require large number of radio buttons or check boxes.
Anyway, i will try the hiding method first. Thanks again~
By the way, do you know how to set cursor position in an Edit control? I tried using setsel() function, but nothing appears...
|
|
|
|
|
You need to have the number of characters before you can set the position ( i.e. if the edit box is empty, then the cursor has nowhere to go ). I'm pretty sure that setsel is the way to go.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
About the original topic again...
if i use showwindow(),how can i hide them later?
and for Edit control, which method should be used to hide them~
|
|
|
|
|
I have found the method already...thanks~
|
|
|
|
|
Sorry, I was in a meeting
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
If you know how many radio buttons will be needed, why not put them on the form, and show/hide them with ShowWindow ?
I agree. One of my applications does this, and trying to create/manage the controls at runtime would be a nightmare.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
how can I remove a button's edge...my button is flat and I want to remove the white edges around it.
|
|
|
|
|
You'll need to subclass CButton and handle its drawing.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I'm tryingt to automate some things and I want control of another program from within my program. For example, I want my C++ program to be able to open Microsoft Excel and print some data into a cell. Or I want my program to open a database application we use and export a query into a text file. Does anyone know how to gain this kind of control of another application from within my C++ program?
Yesterday is history
Tomorrow's a mystery
Today is a gift
That's why they call it the present
Danny
|
|
|
|
|
bugDanny wrote:
I want my C++ program to be able to open Microsoft Excel and print some data into a cell.
You can do this easily with Excel Automation. See MSDN article Q178749 for an example.
bugDanny wrote:
Or I want my program to open a database application we use and export a query into a text file.
I would use ODBC (or ADO) for this. Check out these two MFC classes: CDatabase and CRecordset .
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I am building a simple dialog box based program in Visual C++. I want to allow the user to open a picture in a picture control. If the user clicks inside the picture box, I want it to draw a small circle on the picture where the user clicked.
One problem I am having is that picture controls don't handle mouse events... that is, there are no control events listed for the picture control. How do I add a mousedown event? As you may have noticed, I am a beginner, so please give as much detail as possible.
Thanks!
|
|
|
|
|
Have you used Spy++ to verify that no messages are sent to the picture control?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I don't have Spy++.
Isn't there some way to just add a mouse handling event to the picture control?
|
|
|
|
|
MALDATA wrote:
I don't have Spy++.
How do you know?
MALDATA wrote:
Isn't there some way to just add a mouse handling event to the picture control?
Sure, but if you don't know what messages, if any, are being sent to the control, what's the point? Even if you did add a mouse-handling function, what if it does not work?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Spy++ is not listed in the Visual Studio Tools menu, and I have to assume that's where it would live. If it's somewhere else, please let me know.
I'll see if I can wrangle a copy of spy++... outside of that, what should I do?
|
|
|
|
|
MALDATA wrote:
Spy++ is not listed in the Visual Studio Tools menu, and I have to assume that's where it would live. If it's somewhere else, please let me know.
Could it have been overlooked during installation?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I have an old copy of VC++ 6 somewhere... I know that had Spy++ with it, I'll see if I can find that. Assuming I do, what should I do to make this work?
|
|
|
|
|
MALDATA wrote:
what should I do to make this work?
See this[^] link.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I've used Spy++ before, I just don't see how it helps in this particular case.
I found my old copy and ran it, the picture box doesn't respond to anything.
I've seen stuff like this... is this anything like what I have to do?
PictBox->add_MouseUp(new MouseEventHandler(this, PictureMouseUp));
If so, where does it go?
|
|
|
|
|
MALDATA wrote:
PictBox->add_MouseUp(new MouseEventHandler(this, PictureMouseUp));
Is this VC++ v6?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
No, I'm using Visual C++ in Visual Studio 2005
|
|
|
|
|
Apparently none of that worked out. I know there's a simple solution to this, I just don't know what it is.
Would it be possible to create a CRect object over the picture box and have that respond to the mouse instead of the picture control itself?
Please help... I hate getting hung up on simple stuff like this.
|
|
|
|
|
given a tcp connection and it's remote ip and port address, how do i disconnect a particular tcp connection?
i am trying to build a very simple connection manager/monitor that periodically grabs the tcp connection table (using AllocateAndGetTcpExTableFromStack) and compares it to a loaded list of "unwanted" ip's or hostnames. i've got it able to display the tcp connections (very similar to what netstat does), but not sure how to proceed with disconnecting the ones i don't want. can anyone help me with what function(s) i use to do this?
|
|
|
|
|
Good afternoon.
I have a DLL with a simple function that receives an array of double, the array is used as input/output, part of it I must fill, the rest ( the result ) is filled by the DLL.
the function looks like :
typedef int (__stdcall * CommandProc)(
long, double*, long, long );
I do the following.
m_Data = (double*) calloc( m_Rows * m_Columns, sizeof( double );
int iRes = ProcAdd( 1, m_Data, m_Rows, m_Columns );
The DLL is loaded properly, and the function is called without crashing.
I'm not sure if I'm calling the function with the "right kind" of values ( mostly the double* ; the simplistic documentation that I have tells me its a double* ; so that's what I pass.
I tried doing a simple DLL function with similar parameters to see if I screwed my call :
extern "C" _declspec(dllexport) int toto(
long ID,
double* data,
long rows,
long columns )
{
for ( int i = 0 ; i < rows*colums; i++ )
{
data[i] = 2;
}
return 1;
}
but that seems to work.
any ideas ?
I'm about to contact the DLL vendor to ask them for a working C example of their DLL.
Thanks.
Max.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
So what is ProcAdd() supposed to do with the second parameter?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|