|
Thanks for the help! I forgot the quotes, the directory path should be in Dos 8.3 format, am I correct? Oh well, thanks, all is working now.
-- modified at 7:58 Friday 1st June, 2007
|
|
|
|
|
bankai123 wrote: The AviFile class doesn't use the Vfw32.lib library, but uses vfw.h.
The header file only contains the class declaration. From where do you think the implementation of the methods comes from ? Bingo, from the library file .
In visual studio 2005, go into "Project Properties" -> "Linker" -> "Input" and specify the library in "Additional Dependencies".
|
|
|
|
|
Hi
can any one give me example program (or some thing idea) for
uploading and downloading a file in VC++, i am using MySQL as
an back end.
I can open (BROWSE) but can not select the exact path of file
and i am also unable for uploading it to database.
If any body can...Please help me
Regard's
Kaushik
|
|
|
|
|
|
Y_Kaushik wrote: downloading a file in VC++,
See URLDownloadToFile function.
|
|
|
|
|
Y_Kaushik wrote: can any one give me example program (or some thing idea) for
uploading and downloading a file in VC++...
From/to where?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I add a button on a dialog form. When the butter is on focus,I pressed the "Enter Key", the click event will be invoked. But if I set button's style "Owner draw", the click event will not be invoked when I pressed "Enter".
Could anyone give me the answer. Why?
Not only button, edit and some other controls seem very strange.
|
|
|
|
|
The Enter key will be sent to your button only if your button return DLGC_DEFPUSHBUTTON as response to the WM_GETDLGCODE message. When the owner style is set, this value will not be returned by the button. So the solution is to overide th WM_GETDLGCODE message of the button and return the DLGC_DEFPUSHBUTTON in addition to the default values.
like
return CButton::OnGetDlgCode()|DLGC_DEFPUSHBUTTON ;
|
|
|
|
|
But if I return DLGC_DEFPUSHBUTTON, I can not owner draw its background. Do you have any other better way to handle it.
Thanks a lot.
|
|
|
|
|
ok ok i missed one point. In addition to the above thing handle the BN_SETSTYLE message( you have to manully add it message map. Class wizrad will not show this message ).
in the mesasge map
ON_MESSAGE( BM_SETSTYLE, OnSetStyle )
The function
LRESULT ButtonEx::OnSetStyle( WPARAM wParam_i, LPARAM lParam_i )<br />
{<br />
const int ODDBTN_BS_TYPEMASK = 0x0000000FL;<br />
return DefWindowProc( BM_SETSTYLE, ( wParam_i & ~ODDBTN_BS_TYPEMASK ) | BS_OWNERDRAW, lParam_i );<br />
}
|
|
|
|
|
Ok. Now it works. But I feel a little wonder, what you need to write:
( wParam_i & ~ODDBTN_BS_TYPEMASK ) | BS_OWNERDRAW
why not
BS_OWNERDRAW
or
wParam_i | BS_OWNERDRAW
I still doesn't very clear how to handle edit control's ENTER event.When I set edit's style "multiline", it will accept ENTER event and do the parent Dialog's OnOK() function. But I only want it jump to the next tabstop control or find some function that I can handle the ENTER event.
Thanks for reply.
-- modified at 4:46 Monday 4th June, 2007
|
|
|
|
|
Peter, Chan wrote: But I only want it jump to the next tabstop control or find some function that I can handle the ENTER event
You can handle this in the PreTranslateMesage(). Search for PreTranslateMesage in the message board. You can find many solutions.
|
|
|
|
|
|
Hi Forum,
I need to retrieve the time at which a message was posted (or at least, when it was first handled by the Windows messaging system) in a Callback function set through MFC's MESSAGE_MAP.
Briefly:
- I have a library sending messages (but I have *no control* over that library, I must use it as it is);
- My class registers a callback for this kind of message through MFC's MESSAGE_MAP;
- This class would like to know when the message was posted.
I know the Windows' GetMessage() function gets a MSG struct with this information, but it's removed when sent to the callback :/
And since I use MFC, I can't call GetMessage() myself, can I ?
And as said above, I can't modify the library to add this information as a parameter (for example in the WPARAM, which is transmitted to the callback).
So, is there another way to retrieve the time of arrival of the messages my class is supposed to handle ?
Thanks a lot,
Julien
|
|
|
|
|
CWnd::GetCurrentMessage
This function returns a pointer to the current MSG structure being processed [by a window]. Call it inside a message handler function only.
--
=====
Arman
|
|
|
|
|
hi, i am trying to retrieve domain and user name by the following code
#include "windows.h"
LPTSTR lpszSystemInfo;
DWORD cchBuff = BUFSIZE;
TCHAR tchBuffer[bufsize];
lpszSystemInfo = tchBuffer;
if( GetComputerName(lpszSystemInfo, &cchBuff) )
m_machineName = _bstr_t(lpszSystemInfo);
cchBuff = BUFSIZE;
if (GetComputerNameEx(ComputerNameDnsDomain, lpszSystemInfo, &cchBuff))
m_domain = _bstr_t(lpszSystemInfo);
cchBuff = BUFSIZE;
if( GetUserName(lpszSystemInfo, &cchBuff) )
m_osUsername = _bstr_t(lpszSystemInfo);
This is a part of the code.
When i compile it, I get the following error:
error C2065: 'GetComputerNameEx' : undeclared identifier
error C2065: 'ComputerNameDnsDomain' : undeclared identifier
Can anyone help me solve it?
Moonis
-- modified at 21:39 Sunday 3rd June, 2007
|
|
|
|
|
Please put any code inside < pre>< /pre> tag to view it correctly.
Before including <windows.h> you should define _WIN32_WINNT greater than or equal to 0x500;
#define _WIN32_WINNT 0x0500
#include <windows.h>
--
=====
Arman
|
|
|
|
|
Hi,
I did the above settings to enable the macro but the problem still persists. My modified code is here:
#define _WIN32_WINNT 0x0500
#include "windows.h"
#include "stdio.h"
#include "iostream.h"
#include "tchar.h"
int main()
{
LPTSTR lpszSystemInfo;
DWORD cchBuff=sizeof(lpszSystemInfo);
if (GetComputerNameEx(ComputerNameDnsDomain, lpszSystemInfo, &cchBuff))
cout<<"Domain Name is : "<<cchBuff<<endl;
char acUserName[100];
DWORD nUserName = sizeof(acUserName);
if (GetUserName(acUserName, &nUserName)) {
cout << "User name is " << acUserName << "." << endl;
}
else {
cerr << "Failed to lookup user name, error code " <<
GetLastError() << "." << endl;
}
return 0;
}
I am new to VC++ programming so please point out any other errors if there are.
Moonis
|
|
|
|
|
Which version of platform SDK are you using?If not download the latest platform SDK from the microsoft site.
|
|
|
|
|
Hi,
I am using MS Visual C++ 6.0 running on Windows 2000 Server.
Is the problem related to the above version that i am running?
Moonis
|
|
|
|
|
declaration of this file dosent come with the vc 6. You neeed to download the latest platform SDK
|
|
|
|
|
You have to define the _WIN32_WINNT version to 0x0500 or greater. for this Take
project settings->c++->Preprocessor definition.
In that edit box add _WIN32_WINNT=0x0500
|
|
|
|
|
Hi,
In the msdn documentation for GetComputerNameEx it is given
"To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0500 or later"
have to confirmed it and it required to include windows.h
|
|
|
|
|
hai,
i want to create a dll that loads bitmap.i am a beginner to a dll.anyone please help me. i read http://www.codeproject.com/vbscript/LoadBMPFromDLL.asp".
but they are not giving the vc++ code part .Any please give any basic idea
|
|
|
|
|
What's giving you trouble - loading a bitmap or creating a DLL?
Loading a bitmap is the same in a DLL as in an EXE.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|