|
HtmlHelp(m_hWnd,m_pszHelpFilePath,HH_DISPLAY_TOC /*HH_HELP_CONTEXT*/,0);
or
BOOL WinHelp(HWND hWndMain,LPCTSTR lpszHelp,UINT uCommand,ULONG_PTR dwData);
|
|
|
|
|
Hi guys,
is there any method for retrieve the previose opend file (in the last excution of the program)when the program just being start again?
sorry for my english....
what i want is...
my program has opened a text file, let's say data10.txt...
then close the program
..
open it, then the program while automatically the data10.txt which it has read last time
the file is a text file, so cannot use serializing.
thank u in advance!!!!!!!!!!
|
|
|
|
|
I dont think that program can do it by itself. You should write the filename into some file (for example 'lastfile.dat') on program exit, and when program starts read the filename from 'lastfile.dat' and open it.
|
|
|
|
|
You will need to save the last filename used somewhere, like the registry, in HKCU\Software\jfk_lili\appname\LastFile, for example.
Then on startup, you need a mechanism to detect that the program had no arguments, and then force it to load that file.
If you were using MFC, for instance, you could override your InitInstance to examine the program's command line, where it uses CCommandLineInfo, and if the verb was FileNew, change it to FileOpen and fill in the m_strFileName member. You then call ProcessShellCommand, and it happens automatically.
Steve S
Developer for hire
|
|
|
|
|
Hey,
I have this menu, and I have the options to subtract a certain number from a value selected from a combo box which is displayed in an edit box, and when you select the subtract function, depending on which one you use, it is to subtract that amount from the edit box variable.
Here is the code for them.
<br />
void CDEPDlg::OnOptionsAltertimeTotalcyclingSubtract10minutes() <br />
{<br />
if(totalcycling<=0)<br />
{<br />
totalcycling-=10;<br />
}<br />
}<br />
that is jsut one of the options, I figure that if I can get one working I can get the others working too.
The question is, It is not subtractiong the amount, how can I get it to subtract the amount?
Any help would be great.
Thanks
|
|
|
|
|
Is the "totalcycling" is EditBox member variable.
Then try with UpdateData()
|
|
|
|
|
What is the compiler option for generating the debug info?
I have tried /DEBUG /PDB"something.pdb" but doesn't seem to work.
I need to debug a static library which was built from nmake.
The debug operation need to be done in VC 6 or VC 7.
thank you.
Sonork 100.41263:Anthony_Yio
Life is about experiencing ...
|
|
|
|
|
Linker options:
/debug
/incremental:yes
Compiler options:
/ZI
/Od
Bikram Singh
|
|
|
|
|
I HAVE AN MDI APP WITH TWO CFORMVIEWS THAT I CAN SELECT FROM A PULL DOWN MENU OPTION. I CAN SWITCH TO EITHER FORM VIEW BY SIMPLY CLICKINT IT. THIS WORKS FINE, UNTIL....
PROBLEM: WHEN I CHOOSE NEW WINDOW FROM THE MENU, I DO GET A NEW SET OF CFORMVIEWS, I CAN SWITHC BETWEEN THE TWO NEW FORM VIEWS, BUT WHEN I CLICK ON ONE OF THE PRE-EXISTING FORM VIEWS, I GET AN ERROR, IT'S DESCRIPTION IS SOMETHING LIKE ASSERT(isChild(CRuntimeClass *p).
PLEASE EMAIL ME RESPONSES js_94@hotmail.com
...js..
|
|
|
|
|
I want sth like: after I click 'ok' on a messagebox, a IE window (Doc/View)pop up. However, I don't want to use shell comment to call a compiled execuatable file from a Dialog based application, I want Doc/View and Dialog be within the same project because there will be some parameter passing staff. by the way, I don't want the Doc/View to be nested inside the Dialog as Mr. Guenego's http://www.codeproject.com/docview/dfv.asp
anybody has idea?
|
|
|
|
|
You can do this by creating a normal doc/view app and display the message box in InitInstance of the app class.
|
|
|
|
|
Hello everyone:
Can a message be posted to a dll from other dll? If it can be realized, how to receive and handle it? Pls help me.
Thank you.
-Freehawk
|
|
|
|
|
what do you mean by "post a message" ?
do you mean you want to do a postmessage to a CWnd`or somesuch?
Bryce
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|
|
Hi.
I want to use the function "PostMessage" to post a message to a dll from other dll. But I dont know whether it can be realized.
-Freehawk
|
|
|
|
|
to a dll or to a class or window which is contained in a dll
and your dll is loaded when your app loads presumably?
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|
|
hi,
I want to post a message to dll. in the dll there is not window or dialog.
-Freehawk
|
|
|
|
|
Unless there is a window with a message loop in your dll, then PostMessage would be useless.
Perhaps you should describe what you are wanting to do.
"Live long and prosper." - Spock
|
|
|
|
|
PostThreadMessage() will post a message to a thread that has a GetMessage() loop running.
Bikram Singh
|
|
|
|
|
Thank you for the reply.
Do you tell more details about PostThreadMessage or any source codes?
-Freehawk
|
|
|
|
|
freehawk wrote:
n a message be posted to a dll from other dll?
No. You'll either need to call a function in the other DLL, or use some other form or IPC.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I’m trying to use Wininet to access web pages. If I use InternetOpenUrl, I can access a stock quote off of Yahoo. If I try and use an alternative involving HttpSendRequest, I get an “object not found” error. I have tried different ideas for the Open Request, but with no success....
What am I doing incorrectly?
// the code here in “OnButtonUrl” works
void CHttpAppDlg::OnButtonUrl()
{
HINTERNET hOpenHandle, hConnectHandle, hResourceHandle;
CHAR lpszBuffer[256];
DWORD dwRead, dwFlags, dwStatus;
CString strStatus;
CHttpRequestDlg dlg;
if (IDCANCEL == dlg.DoModal()) return;
m_strResult.Empty();
// Initialize WinInet and create the Internet session
hOpenHandle = InternetOpen("HttpApp/1.1", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
if (!hOpenHandle) return;
hResourceHandle = InternetOpenUrl(hOpenHandle, http://finance.yahoo.com/q?s=intc",NULL,0,0,0);
if (!hResourceHandle)
{
InternetCloseHandle(hOpenHandle);
return;
}
if (!QueryInfoStatusCode(hResourceHandle, dwStatus))
AfxMessageBox("Error in QueryInfoStatusCode");
else
{
if (HTTP_STATUS_OK != dwStatus)
{
CString strMsgFormat("HTTP Status Code: %d, Reason: %s"), strMsg;
if (!QueryInfoStatusText(hResourceHandle, strStatus))
strMsg = "Unknown";
strMsg.Format(strMsgFormat, dwStatus, strStatus);
AfxMessageBox(strMsg);
}
else
{
while (InternetReadFile(hResourceHandle, lpszBuffer, 255, &dwRead))
{
if (dwRead == 0)
break;
lpszBuffer[dwRead]=0;
m_strResult += lpszBuffer;
}
}
}
//cleanup
InternetCloseHandle(hResourceHandle);
InternetCloseHandle(hOpenHandle);
//update dialog
UpdateData(FALSE);
}
This code in “OnOK” does not work. It returns a error 404 “can’t find object”
void CHttpAppDlg::OnOK()
{
LPCTSTR lpszAcceptTypes[] = {"Accept: */*", NULL};
HINTERNET hOpenHandle, hConnectHandle, hResourceHandle;
DWORD dwError = ERROR_INTERNET_FORCE_RETRY, dwErrorCode;
CHAR lpszBuffer[256];
DWORD dwRead, dwFlags, dwStatus;
CString strStatus;
CHttpRequestDlg dlg;
BOOL result;
if (IDCANCEL == dlg.DoModal())
return;
m_strResult.Empty();
// Initialize WinInet and create the Internet session
hOpenHandle = InternetOpen("HttpApp/1.0", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
if (!hOpenHandle) return;
// check to see if the user wants to use SSL
dwFlags = (dlg.m_nPort == 443) ? INTERNET_FLAG_SECURE : 0;
// establish the connection with the HTTP server
hConnectHandle = InternetConnect(hOpenHandle, "www.yahoo.com",
80, NULL, NULL, INTERNET_SERVICE_HTTP,0,0);
if (!hConnectHandle)
{
InternetCloseHandle(hOpenHandle);
return;
}
// create the HTTP request
hResourceHandle = HttpOpenRequest(hConnectHandle,"GET","http://finance.yahoo.com/q?s=intc",
"HTTP/1.1", NULL,(LPCTSTR *) &lpszAcceptTypes,0, 0);
if (!hResourceHandle)
{
InternetCloseHandle(hConnectHandle);
InternetCloseHandle(hOpenHandle);
return;
}
// keep sending until authentication is successful
while ( ERROR_INTERNET_FORCE_RETRY == dwError)
{
result = HttpSendRequest(hResourceHandle, NULL, 0, NULL,0);
// dwErrorCode stores the error code associated with the call to HttpSendRequest.
dwErrorCode = result ? ERROR_SUCCESS : GetLastError();
dwError = InternetErrorDlg(GetSafeHwnd(), hResourceHandle, dwErrorCode, FLAGS_ERROR_UI_FILTER_FOR_ERRORS |
FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS |
FLAGS_ERROR_UI_FLAGS_GENERATE_DATA,
NULL);
}
if (!QueryInfoStatusCode(hResourceHandle, dwStatus))
AfxMessageBox("Error in QueryInfoStatusCode");
else
{
if (HTTP_STATUS_OK != dwStatus)
{
CString strMsgFormat("HTTP Status Code: %d, Reason: %s"), strMsg;
if (!QueryInfoStatusText(hResourceHandle, strStatus))
strMsg = "Unknown";
strMsg.Format(strMsgFormat, dwStatus, strStatus);
AfxMessageBox(strMsg);
}
else
{
while (InternetReadFile(hResourceHandle, lpszBuffer, 255, &dwRead))
{
if (dwRead == 0)
break;
lpszBuffer[dwRead]=0;
m_strResult += lpszBuffer;
}
}
}
//cleanup
InternetCloseHandle(hResourceHandle);
InternetCloseHandle(hConnectHandle);
InternetCloseHandle(hOpenHandle);
//update dialog
UpdateData(FALSE);
}
DanL
|
|
|
|
|
Try:
hConnectHandle = InternetConnect(hOpenHandle, <code>"finance.yahoo.com"</code>, 80, NULL, NULL, INTERNET_SERVICE_HTTP,0,0); and
hResourceHandle = HttpOpenRequest(hConnectHandle,"GET", <code>"/q?s=intc"</code>, "HTTP/1.1", NULL,(LPCTSTR*) &lpszAcceptTypes,0, 0);
rechi
|
|
|
|
|
Yes, it works. I was also able to do a "POST" which is what I was after in the first place.
Thanks so much for taking the time to read and answer my question.
DanL
|
|
|
|
|
Hi there,
I've read articles on how to create tooltips for buttons and other objects but nothing on just plain text. I would like to create tooltips for my submenu items on the IDR_Mainframe. How can I go about doing this?
Thanks!
|
|
|
|
|
|