|
No, nothing is static. I'll try a static variable and see if it works. Thanks.
|
|
|
|
|
Static variables worked! Thanks led mike!
|
|
|
|
|
Good day all :]
Hopefully this is in the right section T__T
A particular topic has really been getting to me lately, programming files with custom extensions.
For example, lets say I have a file with a lot of important data pertaining to a program. I obviously dont want this accessible to the world, so I want to create my own file type, such as data.rid (really important data for the acronym :p)
How would I go about doing something like that? I know it's simple enough to just rename a file, but how would I actually make it work with a program?
Cheers!
-Dia
|
|
|
|
|
That's not complicated at all: when you create the file, you simply gives the extension you want. The extension doesn't mean a lot of things. It's only used by window to associate certain files with certain programs. But a file is still of file, no matter what the extension is.
|
|
|
|
|
Diagathon wrote: For example, lets say I have a file with a lot of important data pertaining to a program. I obviously dont want this accessible to the world...
So do you want to encrypt it?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thank you Cedrick! I now have a better understanding of that aspect :]
David:
I believe that is what I am referring to
How would I go about doing that?
If there is documentation somewhere that I could be pointed to, please share so I dont bother you with typing out a long example :]
Thank you for the fast replies as well! :]
|
|
|
|
|
For instance... you can start in the security section[^] here in CP.
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.
|
|
|
|
|
Aha, thank you very muc
|
|
|
|
|
Is it possible to force the creation of a FrameWnd inside a CWnd object ?
My aim is to exploit the pane-docking inside a certain view.
Already, this view is created inside a ChildFrame which in turn embeds some panes and multiple views (i show one and hide other by mean of switching ids..) and already is it that this ChildFrame is only one among multiple frames inside the main pplication frame which also embeds main panes.
That's why I reached this bizzare situation of needing to embed a FrameWnd
into a CView in which I want to create many UIs inside.
No this situation is not bizzare to the point I should not led myself there, becuase it is an unavoidable situation for a big program that is 1.5 year of dev.
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.
And yes there are things undoable...trying to embed something other than CView inside CSplitterWnd for example...Thank you for your help.
Our Philosophy, Mohammed Baqir Al Sadr
|
|
|
|
|
charfeddine_ahmed wrote: I finally would discover the undoability of the thing
Yes (even though undoability is not a word), and even if you could it's probably not a good idea. There are certainly other ways to dock windows since the .NET framework does it without using MFC in any way. In VS2008 MFC has support for docking from what they call a Feature Pack[^]. Without using that it would be more difficult but not impossible to develop your own code or perhaps find some free source code by searching.
led mike
|
|
|
|
|
thank you M.Mike for your reply,
I just want to be sure of your answer, because I am furious that your yes is about the docking panes I want inside my View...
Of course I will not even think of implementing my own docking code..companies products like bcg GuiToolKit, profuis, xtreemeToolKit were about that complex but powerful feature.
I want to see if I can create a CFrameWnd inside a CView, becuase indeed I will derive the CframeWnd from the MFC extension pack new frame class, and there easily put my panes !
the bridge I saw to create the many UIs inside the View was to be able to embed a frameWnd inside a CView, becuase I already know all the way to the finaly creation of the panes.
now I just use the create function of each Cwnd component I want to put in the View..and I lay them out inside the view statically.. the maximum I did was to intercept the Onsize member of the View and position the child UI component according to some logical ratios..
But after that I found that some redimensioning coming from the outside world of the view (ie the MainFrame, the mlainframe panes, the multiople childframe templates (becuase they can be put vertically or horzonattl,etc) and the spce left for the child frame, then the panes inside the childframe parent of the View I am telling you about) does happen (ie the redimensioning), the logic of ratios become frustrating, so I tried to put splitters between the child UI components of the View and hence let the user resize at his will (i rather say let the program user helps the program itself with the perfect redimensioning of those childUIs).
then came the story of how to put a non-CView derived object into a pane of the very famous CSplitterWnd.The thing has led me to the CSimpleSplitter of someone who published here in an article (and I thank him). CSimpleSplitter is not derived from CSplitterWnd and has the charasteristic of beeing able to host any CWnd type object on its child user-resizable panes.Then came problems with that class, problems which I can go and recite them fearing you may say this person talks too much even though I can go with it supposing that the foregoing newspaper has already lead you to that conclusion.
Now I am thinking of CFrameWnd alternative and yes for that purpose of bringing the support of docking panes. afterall they can be detached, so a pane can take the full size..and also have beautiful header and gripper which I can exploit to put a title text on it.
The MFC is powerful..nevertheless things like some avoidable design and implementation divergeances whcih I think may have been the consequence of believing that users of MFC will not go beyond the initial model put for it, ie for example no one would need an OnCreateClient member inside a CView, --things like that are reducing my happiness, and increasing the happiness of the one who has a drag and drop toolBox from which he can bring a SplitContainer and on top of which he can put whatsoever..
I am not blaming a particular variable..But my blame is on anyone who creates a DockingManager and then require its implementation to be as a member of CFrameDerived object, my blame is on anyone who creates something that is to be integrated in a host with too much preconditions set on that host not to reduce the effective use of what he created.
re undoability is not a word :
i am sorry i am arab.
Our Philosophy, Mohammed Baqir Al Sadr
|
|
|
|
|
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
|
|
|
|