|
Hi,
Is there any way to execute XQuery through MFC Code, I know How to use MSXML.DLL to load xml documents and navigate the XML document But I am looking for a method like ExecuteSQL("") to execute my XQuery statements?
|
|
|
|
|
When my article will be publish?How many days in general?Who have the right to publish the article?
|
|
|
|
|
The Lounge [^] is possibly more appropriate.
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
[My articles]
|
|
|
|
|
HI,
In my application I need to create a employee.dbf file and reading that employee information into employee structure and filling that information into emplyee dialog box.
kir_MFC
|
|
|
|
|
What is a dbf file? Is it a database file?
|
|
|
|
|
|
Are you talking about the ancient dBase database file?
--
Si dos montan un caballo, uno debe ir detrás.
|
|
|
|
|
There are information on dbf file structures available on the web. I suggest you do a search to find the info.
|
|
|
|
|
ODBC would probably be the easiest. If you are using MFC, check out the CRecordset and CDatabase classes.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Did you see Database[^]?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hi,
As i want to display two dialogs and im hiding mainframe.Just i will do all this operations through the buttons in these two dialogs.
So i did in App class as follow
pMainFrame->ShowWindow(SW_HIDE);
pMainFrame->UpdateWindow();
pMainFrame->AlarmBanner();
pMainFrame->ToolTab();
In Mainframe.cpp
void CMainFrame::AlarmBanner()
{
CAlarmBanner *oAbanner;
oAbanner = new CAlarmBanner;
oAbanner->Create(IDD_ALARMBANNER,this);
oAbanner->ShowWindow(SW_SHOW);
}
void CMainFrame::ToolTab()
{
CToolTab *otoolbar;
otoolbar = new CToolTab;
otoolbar->Create(IDD_TOOLBAR_DIALOG,this);
otoolbar->ShowWindow(SW_SHOW);
}
My problem,when i started it is continously flickiering..even it does not open properly.
Wats the mistake..what can i do to avoid that?
By commenting any dialog calling code,the other one works perfectly.But i want to display this two dialogs as one in top of screen and other one in left side of screen.
Anu
|
|
|
|
|
I could not figure out why exactly it is flickering but it seems following points worth considering:
1) pMainFrame->UpdateWindow(); call looks unnecessary.
2) Heap allocations made by using new operator need to be deallocated by using delete operator otherwise results in memory leak.
3) The dialogs need to be explicitly destroyed by calling DestroyWindow() function.
|
|
|
|
|
Now its working .What i changed is.
I gave setwindowpos in OnWindowPosChanging(WINDOWPOS* lpwndpos) in each dialog.Now i replaced that in to OnInitDialog().
Anu
|
|
|
|
|
Flickering could be due to a endless try to refresh the dialogs.
In addition to the previous answer I would take a look on the OnPaint, UpdateWindow or similar messages, and on the interactions between one and the other dialog as well (if there are such interactions), the problem could be there.
I mean...
A updates and try to update B, then B updates and try to update A, so it starts another time and has no end.
Regards.
--------
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
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
hi every one
i need to implemtion of unistd.h in the windows
would you help me please?
Thanks a lot
|
|
|
|
|
Cygwin?
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Why do you need it?
Could you use Cygwin [^] environment?
[added]
Damned monkeys!!!
[/added]
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
[My articles]
|
|
|
|
|
I didn't use cygwin alredy and I want to find a solution except this. if there isn't other way please tell me how can i use it?
thanks a lot.
|
|
|
|
|
How do I get the hToken needed for CreateProcessAsUser? I have a DLL that is loaded runs from the context of user1 and then from user2. From user2, I want to create a process as user1.
From MSDN:
BOOL WINAPI CreateProcessAsUser(
__in_opt HANDLE hToken,
__in_opt LPCTSTR lpApplicationName,
__inout_opt LPTSTR lpCommandLine,
__in_opt LPSECURITY_ATTRIBUTES lpProcessAttributes,
__in_opt LPSECURITY_ATTRIBUTES lpThreadAttributes,
__in BOOL bInheritHandles,
__in DWORD dwCreationFlags,
__in_opt LPVOID lpEnvironment,
__in_opt LPCTSTR lpCurrentDirectory,
__in LPSTARTUPINFO lpStartupInfo,
__out LPPROCESS_INFORMATION lpProcessInformation
);
What I want to do is something like this:
1. user1 process loads my DLL
2. my DLL gets the current process hToken (???this is the part i don't get???)
3. my DLL stores that in a txt file.
4. user1 process closes
5. user2 process starts and loads my DLL
6. my DLL reads all the needed data from txt file
7. my DLL starts a process as user1.
user2 process is always guaranteed to run only *after* user1 process. They don't run simultaneously.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
LogonUser() function can be used to get the token.
|
|
|
|
|
I don't have the password for the user, which LogonUser requires.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
In that case you can enumerate all processes to find out the PID for explorer.exe
Use OpenProcess() API to get process handle for explorer.
Use OpenProcessToken() API to get the token handle for explorer.exe.
Use the this token handle in the CreateProcessAsUser() API.
It would work because explorer.exe runs in the logged-in user's account.
|
|
|
|
|
That might work, but it's inherently an unstable solution, mostly because user1 might be or not be the same user as explorer.exe. It's not guaranteed to be the logged on user. It's just whichever process loaded my DLL first.
Wouldn't it be better to use GetCurrentProcess() instead, while my DLL is loaded in user1 process, and then use OpenProcessToken?
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Yes, it seems GetCurrentProcess() would be a good try.
|
|
|
|
|
Hi,
I have an MFC unicode application which needs to access a database which is UTF-8 encoded. Iam accessing the database through direct query excution using ExecuteSQL function.ExecuteSQL functions expects an LPCTSTR which will be be LPCWSTR under _UNICODE , so i need to format the query as UTF-16 and pass to the ExecuteSQL right?, but the DB is UTF-8 encoded.I need to know whether this will cause any problems.?
Thanks
Krish
|
|
|
|