|
|
Yes,With all due Respect,
sir,
I am including the Smartcard functionality to the login dialog that why i need real source code of MSGINA,as i come to know MS is giving it for free.
thanks
-----------------------------
"I Think It will Work"
Formerly Known As "Alok The Programmer" at CP
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
ThatsAlok wrote:
...as i come to know MS is giving it for free.
Seems to me that if you knew it was being given away for free (if that is indeed accurate), you'd also know how to obtain it. Yes?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
HI there,
Sorry i late to response to this message, i already got the mSGINA dll code in Visual STudio samples
thanks for Replying
-----------------------------
"I Think It will Work"
Formerly Known As "Alok The Programmer" at CP
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hello All excel Automation expert,
I'm having trouble closing excel application. It physically closed.. but the TaskManager Process shows the Excel Process is still running.
The program wait for the excel application to be close by user.. it is waiting forever since the Excel process is still running. How to close the excel application totally?
Is there anyway, not closing excel application and waiting for the user to finish formating or whatever he/she has to do with the worksheet then let the user close the excel file (not excel application). As soon as program knows the user just close the excel ( again , not excel application), the program can open new excel file in the same application?
Thank you.
<br />
ReleaseAllDispatch();<br />
WaitForExcelToClose();<br />
<br />
<br />
void CDlg::WaitForExcelToClose()<br />
{<br />
HWND hWnd;<br />
char buf[1024];<br />
hWnd = ::FindWindow(TEXT("XLMain"),NULL);<br />
if(NULL==hWnd)<br />
{<br />
return;<br />
}<br />
<br />
DWORD pid;<br />
DWORD dThread;<br />
DWORD dwReason;<br />
dThread = ::GetWindowThreadProcessId(hWnd,&pid);<br />
HANDLE hProcess;<br />
hProcess = ::OpenProcess(SYNCHRONIZE|PROCESS_ALL_ACCESS,TRUE,pid);<br />
pid = NULL;<br />
dwReason = ::WaitForSingleObject(hProcess,INFINITE);<br />
::CloseHandle(hProcess); <br />
}
<br />
void CDlg::ReleaseAllDispatch(){<br />
range.DetachDispatch(); <br />
pagesetup.DetachDispatch();<br />
sheet.DetachDispatch(); <br />
sheets.DetachDispatch();<br />
book.DetachDispatch(); <br />
app.DetachDispatch();<br />
<br />
book.ReleaseDispatch(); <br />
books.ReleaseDispatch(); <br />
range.ReleaseDispatch(); <br />
pagesetup.ReleaseDispatch(); <br />
sheet.ReleaseDispatch(); <br />
sheets.ReleaseDispatch(); <br />
app.Quit(); <br />
<br />
app=NULL; <br />
pagesetup = NULL;<br />
range = NULL;<br />
book = NULL;<br />
books = NULL;<br />
sheet = NULL;<br />
sheets = NULL;<br />
<br />
CoUninitialize();
}<br />
|
|
|
|
|
pnpfriend wrote:
hWnd = ::FindWindow(TEXT("XLMain"),NULL);
Not a good idea to use FindWindow() as the target window could be in a blocked state, thus rendering your code "dead."
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi Dave,
what should I use? any suggestion?
|
|
|
|
|
Did you use CreateProcess() or ShellExecuteEx() to start Excel?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Then, how am I going to format the excel if I used ShellExecuteEx() or CreateProcess()?
the following way is to open the excel application. If I used ShellExecuteEx() how to get an app object? if I dont have app obj, I can't get workbooks, no workbooks there will not be no workbook, sheets or sheet. I thought about using ShellExecuteEx() but I don't know how to get workbooks back after that. Any suggestion please?
<br />
CApplication app; <br />
<br />
if(!app.CreateDispatch(TEXT("Excel.Application")))<br />
{<br />
AfxMessageBox(TEXT("Could not create Excel Application Object."));<br />
open = false;<br />
}<br />
else<br />
{<br />
app.put_Visible(TRUE);
app.put_WindowState(2);
app.put_UserControl(TRUE);
<br />
books = app.get_Workbooks();
book = books._Open(fileName, covOptional,covOptional, covOptional, covOptional, covOptional, covOptional,covOptional,covOptional,covOptional,covOptional,covOptional,covOptional);
<br />
sheets = book.get_Sheets();<br />
<br />
int numofSheets =(int) sheets.get_Count(); <br />
int index=1;<br />
<br />
<br />
for( index=1;index <= numofSheets;index++)<br />
{<br />
lpDisp = sheets.get_Item(COleVariant ((short)(index)));
ASSERT(lpDisp);<br />
}<br />
}<br />
|
|
|
|
|
pnpfriend wrote:
If I used ShellExecuteEx() how to get an app object?
You couldn't, hence my reason for clarifying exactly how you were starting the Excel application.
When I use automation with any of the Office products or Internet Explorer, I do so with the intent of there being no user interaction. If I wanted user interaction, I would use CreateProcess() or ShellExecuteEx() . What you have here seems to be the need for both automation and user interaction. Is this a fair assessment?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
True.. I need both automation and user interaction to preview the file first then user print the file manually.
It is hard right?
|
|
|
|
|
I have a VC++ 6 MDI application using the conventional MFC Doc/View architecture. At any given time there can be several different views of several different document types open.
I want to be able to programmatically "activate" one of these Views, i.e. if it is hidden by other Views then I want it to become visible, just as if the User clicked on the relevent numbered item in the Windows menu (NB this does work correctly). The specific View that is to be activated does not directly depend on User input, e.g. it could be as a result of a message from another thread.
This seems to be an obvious thing to be able to do yet I cannot make it work. I am inside a message handler within my CMainFrame class; I have a CMyView* to the View I want to activate. MDIActivate(pMyView) seems to do nothing; I can't get CMDIChildWnd::MDIActivate() to work for me.
Perhaps it is something to do with me using the above functions with a CView* not a CWnd*. Can I deduce the latter from the former in a way that will make this work? What else may be wrong?
All assistance appreciated.
|
|
|
|
|
I want to run this file C:\gzip.exe like I do in the prompt:
gzip.exe -9 C:\myfile.wrl
How can I make the call with the parameters “-9” and “C:\myfile.wrl” ?
_____________________________
...and justice for all
APe
|
|
|
|
|
Either use ShellExecute() or CreateProcess() .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
|
Hi,
i have a sub class of the CMDIChildWnd class and i would like to replace the minimize button with a button with the '*'-sign. This to have a consistent user interface. After a lot of searching I haven't found a way of doing that (Only to remove it with ModifyStyle)
Anyone have any ideas of how to do this?
thx alot
|
|
|
|
|
I think you need to repaint the captions.
have a look at WM_NCPAINT (CWnd::OnNcPaint and related messages and API )
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I'm trying to beat a track and field type game. The game runs on a internet page and requires me to alternately press the 'B' and 'N' buttons :(to gain speed.
Is it possible to write an application that actually sends these characters to the game
|
|
|
|
|
tab1 wrote:
Is it possible to write an application that actually sends these characters to the game
Probably. Are the buttons just standard <input type = button> elements, are are they actually part of a Flash, Shockwave, or ActiveX control?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Haven't got a clue.
Here's the link to the game
http://news.bbc.co.uk/sport1/hi/olympics_2004/herculympics/default.stm
|
|
|
|
|
Notice the paragraph right below the movie:
Visit our Flash Help Page if you have any questions or problems about using the Flash plug-in.
Based on that, I would say to try using SendMessage(WM_CHAR, 'B', 0) to send the keys to that window.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Yes but.......
SendMessage will send the character to the application that i have written. How do i get it to go to the internet page with the flash game on instead?
|
|
|
|
|
SHELLEXECUTEINFO sei = {0};
sei.cbSize = sizeof(SHELLEXECUTEINFO);
sei.fMask = SEE_MASK_NOCLOSEPROCESS;
sei.lpVerb = _T("open");
sei.lpFile = _T("http://news.bbc.co.uk/sport1/hi/olympics_2004/herculympics/default.stm");
sei.nShow = SW_SHOWNORMAL;
ShellExecuteEx(&sei);
WaitForInputIdle(sei.hProcess, INFINITE);
HWND hWnd = FindWindow("IEFrame", NULL);
ShowWindow(hWnd, SW_SHOW);
SetForegroundWindow(hWnd);
SendMessage(hWnd, ...);
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi
Thanks for your continued patience good ideas but......
It still doesn't work.
The SHELLEXECUTEINFO method certainly starts the web page but i couldn't figure out what to do next;
The FindWindow methods also works but it doesn't get my WM_CHAR messages
The method suggested by bdiamond is also not working. Here i created a sdi app with HTML view and used SetTimer is to fire the
SendMessage(WM_CHAR, 'B', 1)
Sleep(100)
SendMessage(WM_CHAR, 'N', 1)
As a check to ensure this was working i put an OnChar handler in there to see my messages working
The funny thing is that when you press charcaters in the view (ie the web page) the OnChar does not catch anything, but the man starts swimming if you pressing the B and N as you are supposed to
Again, thanks for any help
|
|
|
|
|
Or you can always put a webbrowser control in an app and set the address and open the page there. then have a button you can press that loops a million times (or whatever) and use a control variable of the ClassWizard-generated class for the browser control and do a sendmessage().
[insert witty comment here]
bdiamond
|
|
|
|