|
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
|
|
|
|
|
I am trying to Create a Directory with Path length > 260 Characters..
Windows is not allowing me to create when length exceds 260 characters..The function i used is CreateDirectory().. When I saw the SDK Documentation it said I need to Use Unicode Version of this function for a maximum path length of 32767.
I want to know wht is this Unicode version function is?? Also do i need to change any settings in Visual Studio if i want to use Unicode Functions..
If possible can any one explain me the above with an example..
Thanks
Sudhakar
|
|
|
|
|
Sudhakar Pasupunuri wrote:
Also do i need to change any settings in Visual Studio if i want to use Unicode Functions..
Yes, you will need to ensure that both UNICODE and _UNICODE are defined. I would do this at the top of stdafx.h before any files are included.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
If you don't want to change your whole app to be Unicode, you can call CreateDirectoryW() directly.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
There is a saying in statistics that a million monkeys pounding on typewriters would eventually create a work of Shakespeare. Thanks to the Internet, we now know that this is not true.
|
|
|
|
|
If I want to right click on a file and open the file with my program MFC how can I do that?
Please heeeeeeelp.
|
|
|
|
|
Larsson wrote:
If I want to right click on a file...
From where, Windows Explorer?
Larsson wrote:
...and open the file with my program MFC how can I do that?
Is the file's type associated with your application?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
MFC code:
<br />
CRegKey *r=new CRegKey(HKEY_CLASSES_ROOT);<br />
<br />
r->RecurseDeleteKey(".xyz");<br />
r->RecurseDeleteKey("xyzfile");<br />
<br />
r->Create(HKEY_CLASSES_ROOT,".xyz");<br />
r->SetStringValue("","xyzfile");<br />
r->Close();<br />
<br />
r->Create(HKEY_CLASSES_ROOT,"xyzfile");<br />
r->SetStringValue("","file description");<br />
r->Close();<br />
<br />
r->Create(HKEY_CLASSES_ROOT,"xyzfile\\shell\\open\\command");<br />
r->SetStringValue("","c:\\YourApplication.exe \"%1\"");<br />
r->Close();<br />
<br />
r->Create(HKEY_CLASSES_ROOT,"xyzfile\\DefaultIcon");<br />
r->SetStringValue("","c:\\YourApplication.ico");<br />
r->Close();<br />
<br />
delete r;<br />
|
|
|
|
|
that was of course association code.
You can also use .reg files during installation.
Look also at this methods:
CWinApp::EnableShellOpen
CWinApp::ParseCommandLine
CWinApp::ProcessShellCommand
|
|
|
|
|
|
Hi !
Our customers ask to add a dll from one of there partners to our project. (I name their dll 'rasterdll' to prevent misunderstandings). I got the libs, dlls and header files from them and add the necessary code to our application. There are 2 small parts I have to add, call a configuration dialog and a line by line processing (image processing; the rasterdll requests line by line and returns the modified lines). I have to say the rasterdll is called from one of our dll's.
Ok, now the problem. The dialog appears as expected but shows some errors (displays a math-calculated pattern, but the last 2 lines are destroyed (~10000 bytes))(The creator of this piece of software says that the buffer for this pattern is allocated via malloc in the rasterdll). For testing reasons I try the debug version of the rasterdll which displays the calculated pattern without any error. I go on with this debug version to the processing test. There are 2 situations: Sometimes the application crashes when I clear the buffer I got from the rasterdll (where I should store the input line), sometimes the process works as expected and I got a heap crash when I unload OUR dll (which calls rasterdll).
The rasterdll should be stable because it works in the applications that were made by the creator of the rasterdll. I think that the only problem can be an incompatibility. But we have exactly the same versions from visualstudio. I have no idea how to fix this problem. Debugging is nearly impossible and useless in my code. The config-dialog from the rasterdll is called by one line, no chance to make any mistakes. The creator of the rasterdll has no idea too. Hope anybody has some tips.
Many thanX,
Thomas
|
|
|
|
|
hi can anyone help me in making graphs in visual c++. Setting the scale properly.
S@r@
|
|
|
|