|
Please anyone can send a sample application using CAsyncSocket for communicating two clients which are in different ports. Thanks.
Regards,
Vijaya
|
|
|
|
|
wrote: Please anyone can send a sample application using CAsyncSocket for communicating two clients which are in different ports. Thanks.
This[^] will make a good read.
|
|
|
|
|
Hi you back to the codeproject
|
|
|
|
|
WhiteSky wrote: Hi you back to the codeproject
Yes. I was always here. Didn't find the time to post replies or queries.
|
|
|
|
|
Nibu babu thomas wrote: I was always here
Welcome;)
|
|
|
|
|
|
Hi !!!
In my application,I have created one dialog box which showing preview of the symbol.Now i want to insert this symbol in my Application( Autocad).How can i insert this??
Ie if I will click OK button from Dialog box then symbol (preview)should be insert in the Autocad.??
Thanking you
Shah
|
|
|
|
|
AutoCad[^]? Your application?
Shah Satish wrote: How can i insert this?
Really hard to tell.
I assume that the preview is not the actual object that is to be inserted, but rather a small bitmap or similar just to show the user how it looks.
You have to describe the "symbol". What is it? An OLE object, picture or what?
You have to describe the target as well.
What kind of application is it? What does it mean to "insert" a "symbol"?
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
|
|
|
|
|
Symol is from my file..Like C:\\Symbol\\Exchangers\\Exchanger_1_i.dwg
(here Exchanger_1_i.dwg is the symbol and its Autocad drawing)
This is the preview of the dialog box.
|
|
|
|
|
Ok... This is how I understood you so far:
It is the actual commercial CAD application AutoCad and the "symbol" you want to insert is an AutoCad drawing.
So the question is really about "how do I insert an AutoCad symbol in an AutoCad drawing"?
Man, you really picked the wrong forum for this question... Try AutoCad support.
Actually I don't think this is the case, but if I only read the things you're writing, that would be the only conclusion.
The questions in my previous post was meant to narrow the problem down and trying to understand what you're trying to do and how you're trying to do it. At least try to answer those questions if you still want some help.
Perhaps I cannot help you, I don't know that yet since you haven't described your problem in an understandable way, but there might be someone else that can. They would ask you similar questions however.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
|
|
|
|
|
Yeh..You got my question correctly..
See my code..
BOOL CDwgPvDLG::OnInitDialog()
{
CDialog::OnInitDialog();
m_mytext.AddString(_T("Exchanger-Double end"));
m_mytext.AddString(_T("Exchanger-Single end"));
m_mytext.AddString(_T("Exchanger-Double end kettle"));
m_mytext.AddString(_T("Exchanger-Single end kettle"));
m_mytext.AddString(_T("Exchanger-Super"));
m_mytext.AddString(_T("Exchanger-Process Flow"));
if (str == _T("")) {
m_mytext.SetCurSel(0);
mydwg = _T("C:\\Symbol\\Exchangers\\Exchanger_1_i.dwg");
}
else{
m_mytext.SelectString(-1,str);
}
this->Invalidate(FALSE);
return TRUE;
}
void CDwgPvDLG::OnPaint()
{
CDwgPreview ::ShowInDialog (mydwg,this,IDC_PVTYP);
CPaintDC dc(this);
}
void CDwgPvDLG::OnselectionchangeList()
{
int nEntry = m_mytext.GetCurSel();
const IndexEntry *pEntry = m_pPermutedIndex->GetIndexTableEntry(nEntry);
this->Invalidate(FALSE);
}
void CDwgPvDLG ::OnOK()
{
CDialog::OnOK();
m_mytext.GetText(m_mytext.GetCurSel(),str);
}
Shah
|
|
|
|
|
In your code, you can probably call your class roughly like this:
CDwgPvDLG m_DwgPv;
if( IDOK == m_DwgPv.DoModal()) {
CString DWGItem = m_DwgPv.str;
//do whatever you want with the string the user did select in the dialog
}
Hope this helps?
Feel free to ask more.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Thanks for reply..But this is code for Calling dialog box..I have alreday call dialog box through command..only step is how to insert file ( for exmple this is my string n now i want to insert ..("C:\\Symbol\\Exchangers\\Exchanger_1_i.dwg")
every thing should be in On ok().. like..
void CDwgPvDLG ::OnOK()
{
CDialog::OnOK();
m_mytext.GetText(m_mytext.GetCurSel(),str);
ads_point point;
acedGetPoint(NULL,(_T("\nPick position : ")),point);
}
|
|
|
|
|
Shah Satish wrote: every thing should be in On ok().. like..
That is bad style. Have the Dialog do one thing (i.e. get a selection from the user) and do the work from where the dialg had been called.
Possibly by opening other dialogs to get the user to answer more specific questions.
Or are you doing a dialog-based application and this is your main dialog?
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Yeh..This is MFC dialog based application and this is only one and main dialog box..
Your method is also good but main thing is How to insert ??
|
|
|
|
|
Shah Satish wrote: Your method is also good but main thing is How to insert ??
I have not the faintest idea of how to handle a dwg-file.
You would need to know the format, read it, parse it, build an internal representation of it and draw that.
Sorry, but I don't think I can help you with that specific problem.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
I am trying to use a well-documented method to subclass across processes in windows (See the following
http://www.codeproject.com/dll/subhook.asp[^]
Specifically, I'm trying to subclass the taskbar so I can grab WM_PAINT messages and control how my app's taskbar button is drawn. Actually, this is cross-platform development, and in modern window systems the windows taskbar is a ToolbarWindow32 in Win98 its a SysTabControl32.
But anyway, the method to subclass is to do a SetWindowsHookEx to the thread of the desktop control using a dll hook procedure (to get into its process address space) and then immediately subclass the control windproc and unhook.
What I encounter is the following:
I can callSetWindowsHookEx for a specific thread, and windows returns OK, but when I try to send a message to the control (in this case SysTabControl32) my hook proc doesn't pick up the message. (I'm using a WH_WNDPROC hook).
Or, I can call SetWindowsHookEx and specify 0 for the thread (thus making it system-wide) and then my hookproc picks up the init msg, but when I try to subclass, SetWindowLong(...GWL_WNDPROC...) returns 0, so the system-wide hook isn't getting me into the desktop control address space.
In any case, the thread-specific hook SHOULD work, and according to windows, the hook is created, but it never picks up my init msg.
Incidentally, this problem I'm encountering is currently under Win98 (don't ask why). But the specific method of subclassing I'm using is supposed to be the most reliable, and valid across all versions of Windows, past and present.
There's some crucial detail I'm forgetting that would enable me to subclass the windows taskbar. Does anybody know what it is?
|
|
|
|
|
K this is really frusterating. All i need to do is place the exact string representation of an int into the edit control. But the problem is that int is not only thing i need to print to the edit control. So what i need help on is how do get the index of a target line from the edit control, and how do i place a char or int in the target line? I read the win32 api at microsofts website, but did not find what i was looking for. Please please help!
|
|
|
|
|
Can you post some example of what exactly do you want to achieve.
Alternatively, you can store the data from the edit control into a char* and then make changes to the string. Later when you are done with this you can update the edit control to show the new string. I hope that I understood you.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I think the following message will help u
EM_SETSEL and EM_REPLACESEL
Select the string that u want to replace using EM_SETSEL. Now replace that with the new text using the EM_REPLACESEL message.
-- modified at 6:43 Tuesday 30th January, 2007
nave
|
|
|
|
|
asp.netProgrammer wrote: All i need to do is place the exact string representation of an int into the edit control.
See this class for that part Convert Integers to Their Textual Description[^]
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
Wow, thnkx guys. This really helps. And also, the first response was right, I could also just convert my int to string representation using itoa( int, char*, int radix ). Seriously, u guys saved me from late project, thnkx!
|
|
|
|
|
There's also SetDlgItemInt()
|
|
|
|
|
Hi guys,
I am currently trying to get a MFC-application underway. The whole system is compilable and runs smoothly on any computer with VS2005 Pro and Intel Visual Fortran 9.1.
I am having some trouble debugging, though. The app contains several data structures (see below).
<br />
struct one{<br />
double d11, double d12, double d13, ...};<br />
struct two{<br />
double d21, double d22, double d23, ...};<br />
...<br />
struct main{<br />
one onearray[FIRST_CONSTANT],<br />
two twoarray[SECOND_CONSTANT]...<br />
}<br />
Whenever I try to debug, I can get anything from the onearray, but instead of display twoarray, I get an error CXX0033.
I tried everything that came into my mind, from disabling PCH (a very old cause of this error that should be fixed) to cleaning all intermediate files automatically/by hand and rebuilding the application.
Any suggestions?
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
Quick feedback:
Visual Studio with integrated VF seems to be sharing debugging information between the two systems. I found out that there were some fortran records with the same names. As soon as I changed the names of the C-structs from name to name_c, debugging started to work.
Additionally, this only seems to be a problem with structures that are passed along as pointers (e.g. a parameter to a function).
So:
void func(main* myP) is a problem (unable to view myP contents), but void func(main myP) seems to work as expected.
GNARGH!
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|