|
Hello-
I would like to build an interface with dockable pieces to it. These pieces probably most closely resemble a dialog box. That is, they have several controls as components.
I would like to construct the pieces by code -- without the dialog editor. I'm quite new to all of this, so I may be attacking this the wrong way, but I am looking at the CDialogBar class which is at least a start for dockable dialogs, but doesn't allow creation without a resource ID.
Is there a better approach? How can I create a CDialogBar without a resource ID?
|
|
|
|
|
hi,
Its good that i experienced the same problem. And found the solution for myself. This really works:
Here is the header file :
class cSmithChart:public CDialog
{
public:
int m_iChartSize;int m_iLineColor;
cSmithChart();
~cSmithChart();
void drawSmithChart();
afx_msg void OnPaint();
DECLARE_MESSAGE_MAP()
};
The implementation file :
cSmithChart::cSmithChart():CDialog()
{
DLGTEMPLATE *tmplate = new DLGTEMPLATE[4];
DLGTEMPLATE tmpl;
tmpl.cdit=0;
tmpl.style=DS_NOFAILCREATE |WS_CAPTION | WS_SYSMENU;
tmpl.x=0;
tmpl.y = 0;
tmpl.cx = 500;
tmpl.cy = 500;
tmpl.dwExtendedStyle=0;
tmplate[0] = tmpl;
tmplate[1].style=0;
tmplate[1].dwExtendedStyle=0;
int nresult = InitModalIndirect(tmplate,NULL);;
if( nresult == 0)
{
int error = GetLastError();
AfxMessageBox("Dialog Creation Failed");
}
};
cSmithChart::~cSmithChart()
{
};
BEGIN_MESSAGE_MAP(cSmithChart, CDialog)
ON_WM_PAINT()
END_MESSAGE_MAP()
void cSmithChart::OnPaint()
{
CDialog::OnPaint();
drawSmithChart();
}
void cSmithChart::drawSmithChart()
{
//Draw the smithchart
}
AS you could see i solved this for drawing a smithchart, which was a distributed .Lib file..
This is a production code. See if it works for you.
Good Luck.
John Silvester A
Asst. Manager -Projects,
SRA Systems Ltd., Chennai India
|
|
|
|
|
I want to enter in yahoo messenger window from my application i.e. login screen will be somehow skipped. Although I am trying to employ message hook, but don't know what to do and how to do.
|
|
|
|
|
Hi,
If you want to know more about hooking, try the article search! this[^] is just one out of many..
good luck!
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
the link which U gv doesn't work. Moreover I am looking for Message Hooking
|
|
|
|
|
strange! The link works fine for me..
|
|
|
|
|
I am trying to send float value using Sendmessage
the source is following
float lpar = MAKEPARAM( wkpoint.x, wkpoint.y );
SendMessage( mycontrol -> m_hwnd, WM_LBUTTONDOWN, 0, lpar );
the target I want to send to is
OnMouseDownMyCtrl(short Button, short Shift, float X, float Y)
when I call sendmessage and it invokes onmousedowmyctrl event, however
what i get for x and y is totally different from wkpoint.x and wkpoint.y
any help is appreciated.
|
|
|
|
|
you can convert float to string and then pass the string value(address)
or you can pass the address of float
|
|
|
|
|
Thanks for your post.
If you want to conver from float to string, I have to change the parameter for OnMouseDownMyCtrl. I can't not do that since we have already put a lot code inside of this function
OnMouseDownMyCtrl(short Button, short Shift, float X, float Y)
|
|
|
|
|
float *pfVal = new float;
*pfVal = MAKEPARAM( wkpoint.x, wkpoint.y );
SendMessage( mycontrol -> m_hwnd, WM_LBUTTONDOWN, 0, (LPARAM)pfVal);
delete pfVal;
try it and let me know wheather it worked?
My God is more powerfull Than Your God. (the line that divides the world)
|
|
|
|
|
Thanks for your post.
Looks like it fails at SendMessage() and can't go to the even function OnMouseDown
I am still trying.
Regards,
|
|
|
|
|
Would you help me to get the line features that near a pont?
For example, I had gotten a point pt(x,y), how could I get the line features that near the point? thanks advance.
|
|
|
|
|
I want this to be a challenging science fair topic due for next year so it could be anything, just try to be serious about it. If this is a bother then tell me to delete it.;P (Involving computer science and either c++ or visual c++ 6)
|
|
|
|
|
Control something - a radio control car, a homemade robot - it neddn't be too fancy. Build a model village and run the stoplights and house lighting with the computer. Write a crypto algorithm that people can type a message into and see what comes out, demonstrating secure website principles. Or you could always do the standard volcano, erupting all over a computer.;P
"Another day done - All targets met; all systems fully operational; all customers satisfied; all staff keen and well motivated; all pigs fed and ready to fly" - Jennie A.
|
|
|
|
|
In one of my science project a guy had build to control the lights and other stuff using computer program. But they were communicated by wireless system.
You need the knowledge of industrial electronics as well. This project won first price.
My God is more powerfull Than Your God. (the line that divides the world)
|
|
|
|
|
In our chemistry class back at school we did some sort of titation automate: reading the pH from a pH-meter, and using a computer controled syringe pump to set the pH to neutral.
But I must admit that it never really worked...
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Hello,
I've searched the code project but haven't found any samples for what I'm looking for.
What I'd like to do is have a frame containing a tree view on the left and a list view on the right (not a splitter window). Sounds simple, but I don't have a quick reference to sort out the CFrame's needs. Any pointers and references would be appreciated!
thanks!
JennyP
|
|
|
|
|
|
Hello. Not a split of the same view, but rather two different types of views.
Thanks!
JennyP
|
|
|
|
|
Sounds remarkably like the wizard-generated layout produced by VC++ when you select the "explorer style" option.
If you're thinking more of a tree with columns sorta thing, then do a search here - there are at least a couple of articles related to accomplishing that.
Shog9
---
You'd better turn back, before the frost sets in.
These desert nights are for weathered men,
The ones who've already given in...
|
|
|
|
|
Hi,
I´m developing an app that has a treeview on the left, a formview on the top right and CView or CRichEditView on the bottom right with splitter bars in between. The treeview selects different views for the right hand side views (they can be of any view type). The code I admit is not elegant but it works very nicely. I think I found an artice here that I based my code on. Take a look at the Splitter windows section under MFC Controls here on CodeProject.
best of luck to you,
Snorri
|
|
|
|
|
Its quite simple to do it, select the view as form view.
The form view is very much like a dialog, place the treectrl on the left and list view on the right,now you need to adjust the size of the treectrl and the list ctrl accrouding the percentage of the client area.
say 30% of x-axix to tree ctrl and 70% of x-axis to list ctrl and 100% of y-axis to both list and tree ctrl.
i hope i answered your question
Regards,
Prakash.
My God is more powerfull Than Your God. (the line that divides the world)
|
|
|
|
|
hello
Heres the generic situation ...
lets say i have a two machines connected via a socket and messages have been passing though all groovy like. Using send(theSocket etc etc
now, someone pulls out a cable
a Send from machine 1 will place the message in the queue for sending and send(theSocket... will report that it has done it's job.
How can i tell the socket/winsock to fail if the message didnt go through to the target right away?
i guess i'm asking how can i tell if a TCP message actually made its way across the network to the target PC.
Hmmmm
cheers
Bryce
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|
|
first of all let me suggest a good winsock book. Any socket book will do.
Okay...basically you have machine 1 that will listen for a connection to it. This is a server. Machine 2 is the client. The client creates a socket connection to the server which is listening for a client. When the cable is pulled between the two machines and the client tries to send to the server the socket returns back an error. What ever the last thing was that you were trying to send is what was not sent to the server.
Hope this helps.....but it might be better if you got a good book and read up on sockets... I afradi that I can't recommend one because I cna't name any off the top of my head, but there are two that I have in my office that are really good and if you want to email me I can emails back the titles and the authors.
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
well no the send( ) doesnt return an error when the client's cable is pulled out
on a network
the tcp message is queued and it tcp tries sending it again until it times out i suppose
I'll hafta think on this
bryce
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|