|
Dear All,
I am working on MSXML. Here I need to do is that converting regitrykey s into XML tags.
Here I have mostly done with keys and tags.
My problem is I cant maintain the control like tree structure on XML file?
I need a logic to do this.
Kindly help me.
Thanks
-- modified at 1:34 Wednesday 22nd November, 2006
|
|
|
|
|
Hi,
XML, HTML, XHTML, etc... are all tree structure based languages, so there's no way to provent you from maintaining tree structure in XML file. Use attributes (eg. Id, parentId) to obtain such functionality.
...
mom
..|-node0 (parent=mom)
....|-node1 (parent=node0)
....|-node2 (parent=node0)
...
Hope that helps,
Regards
-- modified at 4:39 Wednesday 22nd November, 2006
|
|
|
|
|
I try to use 'KBDLLHOOKSTRUCT' and I get the error undeclared identifier.
When I compile the ForTheKids, it is alright!
Please help!
|
|
|
|
|
Is that a console project? If so have you included the header file "Windows.h"?
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
It is a mfc dialog project!
Both windows.h and winuser.h are included!
Please help!
|
|
|
|
|
Is there any other error you get? Is that you are using ULONG_PTR as it is? Is that defined? If not, try defining ULONG_PTR as #define ULONG_PTR ULONG* in your stdafx.h
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
I don't get any other error!
Please help!
|
|
|
|
|
_WIN32_WINNT=0x0401
Set this macro in the project setting->C++->Preprocessor definition
|
|
|
|
|
I think, you need to download latest platform SDK.
|
|
|
|
|
But I can comply the ForTheKid program without any error!
Is it related to any setting problem?
Please help!
|
|
|
|
|
|
Hi all,
I wrote a program that checks whether another process of the same kind is running, and it's working. But my question is will the same program work, if two different computer(user) sessions are open and the they try to open an application (which I have cattered for) more than once.
An example I can give is the following: A user can use remote desktop to login and another user can use VNC which creates more than one user session. The two users do not know of one another and they decide to open an application. But only one session of this application may be opened. Is it possible to check for both of the sessions, to prevent the program from being opened more than one.
Many thanx
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Hi,
You can use Mutex or Semaphore in global namespace. Global objects are visible in all sessions.
Example:
HANDLE hSemaphore = NULL;
LPCTSTR pGlobalName = _T("Global\\MyInstance_938759");
hSemaphore = OpenSemaphore(SEMAPHORE_ALL_ACCESS, FALSE, pGlobalName);
if (!hSemaphore) {
hSemaphore = CreateSemaphore(NULL, 0, 2, pGlobalName);
} else {
return 0;
} Hope that helps
Regards
|
|
|
|
|
Thank you very much Galatei
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
How about ALWAYS trying to create, instead of open and THEN create.
You leave a small window of opportunity for your thread to be switched out, and then you try the create, and it can fail, and you are not chekcing for that failure (error already exists...).
If you always try create in the first place, you can get back 'error alrady exists', and you know that you are already there, or else you ae the first one.
Your exmaple is generally acceptable, but not technically correct.
|
|
|
|
|
In my example, you can use Opened semaphore for IPC.
Generally, creating to fail and then checking is not correct, it may be cause of serious problems.
If you try to create file which should be reported as existing, but it wasn't reported because of some disk I/O failure, you may end up scratching your desk with your teeths.
It's like this
"go shopping, get new MP3 player, go to the cash-desk, and finally find out that you don't have enough money." <- How about checking your wallet before you even leave your home?
Regards
|
|
|
|
|
Correct, in all accounts, except we were not talking about creating a file, we were creating a sempahore WHICH you were going to create anwyays.
On a fairly loaded terminal services server, I have ALREADy seen code like yours fail. For exactly the reasons I mentioned.
|
|
|
|
|
You mean BADLY implemented apps, sure.
My implementation wouldn't fail, because of error checking on every important step!
So, if OpenSemaphore is NOT_EXISTS, and CreateSemaphore return EXISTS, I still have correct information.
Implementation like yours is like M$ way of security. Always trying to harm first, hoping that its security system will prevent from that.
You should learn from linux implementation (check first, and act if it is possible).
Regards
|
|
|
|
|
i have dll file and header for dll but i ont hev .lib file for that how to get that .can anybody help me out
|
|
|
|
|
abrakadbra wrote: i have dll file and header for dll but i ont hev .lib file for that how to get that .can anybody help me out
then you have to dynamically load function or take long route.. i never tried, but have a try make a new dll based project with same dll name .. this will generate you new lib file.. which i believe can be used with existing dll... my assumption is that dll lib file contain runtime declaration of function signature
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
You need to have some exported symbol/function to generate .lib .
|
|
|
|
|
can you pls tell me in more detail how to do this
|
|
|
|
|
A Quick search on CP gives me list of articles.
Here one of them[^].
|
|
|
|
|
|
I can use FindWindow("#32770", "MFCProgramName") to find a MFC program's dialog, and then I can PostMessage() to the dialog.
How can I send message to a Win32 Console Application?
Thanks!
|
|
|
|