|
This brings me to the original point. When you look through MSDN for description of the function at the bottom of the page you see the following table:
Stock Implementation wininet.dll
Custom Implementation No
Header Wininet.h
Import library Wininet.lib
Minimum availability Internet Explorer 5
Minimum operating systems Windows NT 4.0, Windows 95, Windows CE 2.12
Which implies that you have to link to Wininet.lib(you got that), AND you have to include Wininet.h (you did not get that).
|
|
|
|
|
Just in case you forgot, in begining of stdafx.h you should have something like
#define _WIN32_IE 0x0500 //_WIN32_IE>=0x0500
|
|
|
|
|
Right, done all that.
I've linked with wininet.lib, #include'd wininet.h, and added the line you suggested to stdafx.h. no joy, however - I still get the same error messages.
I've looked through wininet.h and can't find the prototype for FtpCommand() which makes me think i might need an update...? Although MSDN (on the web - not my copy) mentions that this function should be available from Win95 up. I'm using Win98 SE.
Any ideas?
btw: really appreciate the help!
-Alex
|
|
|
|
|
I do not have VC6 at hand, but I suspect you need to download/install Platform SDK, where the Wininet.h is up to date. it is free but you have to search msdn.microsoft.com for it.
|
|
|
|
|
Cheers mate. That sorted it. It's amazing how hard it is to come across anything that makes you think that this could be the problem.
Thanks again,
Alex
|
|
|
|
|
I created a CButton with the BS_ICON and BS_TEXT flags. However I do not see the text. Is it possible to create a button with an icon and text with the default CButton? or must I use a derived class with ownerdraw ?
|
|
|
|
|
Hi,
I have a CPropertySheet window that has two pages. How can I do to make the width of each tab increase, if necessary, to each row of tabs fills the entire width of the tab control ?
thanks.
|
|
|
|
|
I want the user to type in a command in my edit box and then press enter to execute it.
I've subclassed my edit and intercept WM_COMMAND and VK_RETURN from LPARAM in the WndProc. But when I press enter, an annoying sound, like "pling" is playing. I don't want that sound! How to do?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
why dont you intercept OnOK()(or edit) and then execute it... or do i understand you wrong?
|
|
|
|
|
Again I forgot to tell that I'm doing pure Win32 programming!
Damn me!
NO MFC!
Do you know how to do it in Win32?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
nope, sorry,... my next solution would be to turn off the windows sounds...
|
|
|
|
|
Can you intercept the WM_KEYDOWN message with wParam == VK_RETURN when the focus is on the edit control?
Then just stop the edit control from processing it.
Roger Allen
Sonork 100.10016
WHats brown and sticky?
A stick or some smelly stuff!
|
|
|
|
|
Roger Allen wrote:
Can you intercept the WM_KEYDOWN message with wParam == VK_RETURN when the focus is on the edit control?
That's what I'm doing!
I wrote WM_COMMAND in the previous post but I meant WM_KEYDOWN.
Roger Allen wrote:
Then just stop the edit control from processing it.
Huh?
How!?
Hm... you mean in the message loop?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Rickard Andersson wrote:
message loop?
Yeehaaa!!
No "pling" anymore!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Yes, for example:
case VK_RETURN:
return 0;
That's what I do for all my keys that I want to disable...Win32 rocks!
|
|
|
|
|
georgiek50 wrote:
Win32 rocks!
Yeah!
It does!!!!
Are you doing much Win32 programming?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
I am doing as much at time permits. I am a beginner, have been doing this for about 7-8 months. I started with Win32 with hopes to get an understanding of Windows then move to MFC but I decided to stick to Win32 for a lot longer because I don't like how MFC pre-writes code because at my level of programming I won't understand the written code I think and I hate not knowing what's going on. I picked up Petzold's book which was the best programming book I've read to date and I just work on a single program that I have on the internet putting in all different kinds of features to cover as many different aspects of programming as possible. I would like to do this professionaly eventualy. I assume you are? How is the work and how is the pay in Sweden for programmers?
|
|
|
|
|
georgiek50 wrote:
Petzold's book
Very good one!
georgiek50 wrote:
I assume you are?
Well, I have programming as a hobby, but in future I will be a professional programmer!
georgiek50 wrote:
How is the work and how is the pay in Sweden for programmers?
Actually I don't know.
Do you have a homepage?
ICQ?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Homepage: www.movietrack.net
ICQ: No, but MSN id: georgiek50@hotmail.com if you have MSN messenger. So if it is not your work, what is it you do? Student/Other job?
|
|
|
|
|
I've got this working:
The Thread:
<br />
<small>UINT CheckMessages(LPVOID Param)<br />
{<br />
CString tekst = "This is a tekst or maybe a structure";<br />
::PostMessage((HWND)Param, WM_DATARECEIVED, (WPARAM)&tekst, 0);<br />
return 0;<br />
}</small><br />
The header:
<br />
<small>protected:<br />
afx_msg void OnDataReceived(WPARAM wParam, LPARAM lParam);<br />
DECLARE_MESSAGE_MAP()</small><br />
The Function:
<br />
<small>BEGIN_MESSAGE_MAP(CPLCClientView, CFormView)<br />
ON_MESSAGE(WM_DATARECEIVED, OnDataReceived)<br />
END_MESSAGE_MAP()<br />
<br />
...<br />
<br />
...<br />
<br />
void CMyClass::OnDataReceived(WPARAM wParam, LPARAM lParam)<br />
{<br />
CString tekst = (CString)wParam;
AfxMessageBox(tekst);<br />
}</small>
If i execute this i get a weird looking character(because i get a number with wParam), how can i send the CString towards my function?
me = Visual C++ n00b
|
|
|
|
|
willempipi wrote:
void CMyClass::OnDataReceived(WPARAM wParam, LPARAM lParam)
{
CString tekst = (CString)wParam; // or something like that....
AfxMessageBox(tekst);
}
Where you cast the wParam to a CString, I think you should cast it to a CString* instead. You will find however that this too will not work as you expect though. By the time you execute the message handler, OnDataReceived, the thread proc will have already finished and the instance of a CString on the stack will no longer exist. I would suggest that you 'new' a CString in the thread proc and then 'delete' the CString in the OnDataReceived method.
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
"AAAAAAAAAHHHHHH!!!!! Those leaks are driving me crazy! How does one finds a memory leak in a garbage collected environment ??! Daniel Turini Nov. 2, 2002.
|
|
|
|
|
Chris Meech wrote:
I would suggest that you 'new' a CString in the thread proc
can't i send the CString with the Message toward the function (like OnPaint sends a point value with it's message) so that it would look a little like this:
<small>void CPLCClientView::OnDataReceived(CString tekst)<br />
{<br />
AfxMessageBox(tekst);<br />
}</small>
The Visual C++ n00p
|
|
|
|
|
willempipi wrote:
can't i send the CString with the Message toward the function (like OnPaint sends a point value with it's message) so that it would look a little like this:
Since you're dealing with user defined messages, no. Sending your own message and handling it with ON_MESSAGE requires you to provide a function declarated like that you did before (with WPARAM and LPARAM as parameters). Only then the message is handled correctly. It's not comparable to messages like WM_PAINT. These are special messages handled by corresponding functions which for sure can have other parameter types.
In fact, you should do it the way described before by creating your CString on the heap (calling new) and passing it as WPARAM to your function.
|
|
|
|
|
Schlaubi wrote:
creating your CString on the heap (calling new)
how do you mean this precisly? like this:
CString tekst = new CString;
and,
after i created the tekst, do i have to delete it?
|
|
|
|
|
in your thread:
CString *tekst = new CString("blablabla");<br />
<br />
PostMessage(hWnd, WM_MYMESSAGE, (WPARAM)tekst, 0);
in MyFunc:
...
CString* pStr = (CString*)wParam;<br />
<br />
do_sth_with_string<br />
<br />
delete pStr;
|
|
|
|