|
charfeddine_ahmed wrote: because I am furious that your yes is about the docking panes I want inside my View
I'm not sure what that means but since I am freely giving my answers under no obligation, how logical is it for you to take exception to my reply even if it is "the sky is red"?
charfeddine_ahmed wrote: The MFC is powerful..nevertheless things like some avoidable design and implementation divergeances
Yes the flexibility of MFC is not limitless. This is largely due to Microsoft holding the line on backwards compatibility in contrast with the origins of MFC. The framework was developed to support 16bit Windows GUI development back in a time when the industry as a whole wasn't exactly advanced in the area of Object Oriented Design like it is today. I know people complain all the time about MFC but I would like to see someones version of a superior Windows GUI Framework developed in that same time.
One of the concerns I would have about using a CFrameWnd as a child of a CView is the potential side effects on the Command and Message routing mechanism support built into CCmdTarget . But go ahead and try if you like, no law against it. Good luck
led mike
|
|
|
|
|
charfeddine_ahmed wrote: I am not too interested with the long answer, becuase i I only fear the time I would lose after I finally would discover the undoability of the thing, and hence a honest yes by someone who managed to do it would suffice to me.
What makes you think that option chosen by you wont lead to the contion you mentioned above??
I am just curious
|
|
|
|
|
If someone managed to do it, and he only tells me he did it, then I am sure I will manage to do it too. My all life was spent in putting views inside controls, frames inside toolbars...and my results were such yes there can be walls impossible to break.
for this reason, I want to check the doability by the actual doability while of course if I do'nt receive a yes, then it wouldn't affect its doability relative to me.
You can take my question as an invitation for someone who did it to tell me the "yes", without making him feel he will be obliged to tell me the solution..
becuase the answer I would receive is an incresed debt to my many debts from these very angels like M.Mike and the others who do not hesitte to lend a helpful hand at any time ..
Our Philosophy, Mohammed Baqir Al Sadr
|
|
|
|
|
Hi
I am struck with the following problem. I want to get all running servers in the current network using C#. I searched a lot in google an msn but no information related to my issue came. Please any one can help me regarding this issue.
Thanking you.
|
|
|
|
|
Member 4750761 wrote: using C#
Please ask C# questions in the C# forum[^].
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
The question you are asking makes no sense in its current form. OPC is an automation standard which can be implemented on any communication layer. I am assuming that you have some industrial PLC which are probably communicating over a serial pair using Modbus or whatever protocol and you probably want to talk to an OPC server over a cat-5 network and log some data about each node. Unfortunately you have not given enough details to form a response.
Your question really isn't C++ nor C# related. I would suggest contacting the support group where you purchased your OPC server software and/or contacting the PLC manufacturer.
Best Wishes,
-David Delaune
|
|
|
|
|
error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [4]' to 'LPCWSTR'
Also i would like to see the char manipulations samples(Link).
|
|
|
|
|
It is because UNICODE is defined. This article[^] explains all you need to know
|
|
|
|
|
Two alternatives:
(1) Change the Character Set option of your project (currently is Use Unicode Character Set ). You can do this selecting Project->Properties menu item, then Configuration Properties->General node and finally the Character Set list item.
(2) Change you variable type. For instance
char msg[]="foo";
should become
TCHAR msg[]=_T("foo");
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
for converting const strings to wide char you can just add L.
e.g. L"SomeText".
|
|
|
|
|
Hi everybody..
I am doing project on gsm modem.i am reading msg from sim.that read message i want to store into database.for that i have split that sentence so please tell me how to do that.. i am doing like this..
char str[1000];
strcpy(str,m_sResults);
MessageBox(str);
char delims[] = ",";
char* result;
result = strtok( str, delims );
while(result != NULL )
{
MessageBox(result);
result = strtok( NULL, delims );
}
but doing like this is impossible to store the values.so i want to store in different variables.please help me out.
in m_sResults the sentence is
AT+CMGR=1
+CMGR: "REC READ","919860716641","P apu.soni","08/05/22,19:05:34+34",145,4,0,0,"919890081132",145,106
Call me when you reach to your pg... I on the way to room..
OK
please help me.
thanks in advance,
savitri
|
|
|
|
|
Don't use strtok since internally it uses a static buffer which will cause problem with calls from multiple threads or simultaneous calls on different strings.
Instead use strtok_s/_tcstok_s, a demo -> http://www.tenouk.com/cpluscodesnippet/viewtopic.php?p=474[^]
Use vector<string> to store strings that are tokenized by this function.
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
|
Graham Bradshaw wrote: Mutliple threads is OK, apparently.
Thanks Graham!
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
don't use the token related functions for delimited file streams as they are dumb when faced with somthing like...
One,Two,Three,,,Six,Seven,...
It treats the three consecutive commas as one which could lead to unexpected results if those delimiters should be treated as "nothing" values for their respective indexes.
|
|
|
|
|
You can also use stringstream to parse strings. Since I couldn't find a reference, i wrote a quick sample. Check it below.
#include "string"
#include "vector"
#include "sstream"
...
string sResult(_T("Hello,can,you,split,me?"));
istringstream ResultParser( sResult );
string sToken;
vector<string> vResults;
while ( getline( ResultParser, sToken, ',' ))
{
vResults.push_back( sToken );
}</string>
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Hi. I have a little question:
I need to convert a memory direction printed on a CString variable, to a LPVOID variable. Example:
CString auxstr;
auxstr.Format(_T("%p"),p_Stereo);
LPVOID pointer = (LPVOID) ??????? variter->second.value;
I don't know how to convert this string to be able to cast it as a LPVOID. Anyone knows how? Thanks.
Ricard
|
|
|
|
|
Well as the pointer adresses are 0xADRESS, should you not convert from CString into Hex and then make the assignment?
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Yes, I suppose I should. But I can`t find this conversion (from cstring to hex). Is this from the atoi, atof...family? Can't find this.
Thank you so much.
|
|
|
|
|
Use strtol function. Specify base as 16.
e.g.
const long Val = strtol( "0xffff", NULL, 16 );
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
This works perfectly....but as you can see, now i have many doubts for it to be the best solution. The overall plan, not yours.
Thank you..
|
|
|
|
|
The question, why do you store the address in a CString object in the first place ? Can't you simply store it directly in your LPVOID pointer ? It seems a bit crazy to use a CString in between.
|
|
|
|
|
No i can't. It's the way my program sends information between program blocks. In most cases they just send numbers or strings, but now i need to send an object.
|
|
|
|
|
Yeah, but why do you store that address in a CString instead of simply sending the address ? You can only exchange CString objects ?
|
|
|
|
|
Ritxi wrote: It's the way my program sends information between program blocks.
Basically your 'programs blocks' communicate via e-mail. This is crazy programming, isn't it?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|