|
Some applications have an invisible window so they can get WM messages...
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
thats y im asking.....how to get message frm windows n how to register for device notification????
bye have a nice day.....
|
|
|
|
|
You can search the entire Internet with Google, or just CodeProject with the search
facility on top on most CP pages. That will turn up a bunch of good articles like this one[^], showing you how to override WndProc and get messages.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
i knw... but my window in not getting any message... i checked it with Spy++.... even if i code WndProc(..)... nothing is going to happen because my console window is not getting message from windows...may b some error in RegisterDeviceNotification(...)>.... but i don't knw whats wrong???
bye have a nice day.....
|
|
|
|
|
AFAIK a console window is not a regular window, you may have trouble overriding its WndProc.
Why can't you do it as shown by other people?
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Make your own window with CreateWindowEx[^] rather than trying to use an existing console window and see if that works...
|
|
|
|
|
yaa its working.. thnx..
bye have a nice day.....
|
|
|
|
|
when to use what?
Thanks!!
|
|
|
|
|
You use each type when you need to use them. Value types are usually simple types such as int, double, etc. Ref (reference) types are more complex types such as XmlDocument, FileInfo, etc. So, the decision when to use a value or ref type depends on your current needs. However, values types naturally use less resources and are easier to manage.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Thanks...
Getting a bit confused with error c3149 - I understand MSDN doc, but not sure if the following is the same as problem described in c3149 doc. Why wouldn't compiler let me just pass-in a parameter by value?
<br />
c:\...\utilities\Tokenizer.h(10) : error C3149: 'System::String' : cannot use this type here without a top-level '^'<br />
Here's the simple class:
<br />
public ref class CTokenizer<br />
{<br />
public:<br />
CTokenizer(void);<br />
<br />
static ArrayList Tokenize(String strInput);<br />
<br />
};
Of course, this fixed it:
<br />
public ref class CTokenizer<br />
{<br />
public:<br />
CTokenizer(void);<br />
<br />
static ArrayList Tokenize(String^ strInput);<br />
<br />
};<br />
What's the reason behind compiler not letting us to pass in a String param by value? Also just realised String implemented: String.Split Method (String[], StringSplitOptions)
Thanks
|
|
|
|
|
First of all, many ref types in the .NET Framework don't have a copy constructor or assignment operator. Specifically, a String is immutable and is not allowed in this situation. array<T> , also, cannot be coded with stack semantics.
-- modified at 7:35 Friday 14th September, 2007
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Hi there!
How do we call these methods from dotnet? Is there any dotnet wrapper?
InternetOpenUrlA
HttpQueryInfoA
InternetReadFile
FormatMessage
Thanks!!
|
|
|
|
|
|
If there are two mouses(A,B) pluged in a computer, I wonder how to distinguish A from B.
plz help me
|
|
|
|
|
The two mice send the same signal. I doubt it's possible to work out which is which.
Also, I suspect you meant to ask this in the Visual C++ forum.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Ok Thnak you very much.
|
|
|
|
|
Charles of Korea wrote: I wonder how to distinguish A from B.
Make sure they are different colors?
Gary
|
|
|
|
|
|
You could use FtpFindFirstFile(), InternetFindNextFile(), and InternetCloseHandle() to
get the filenames using a wildcard.
For each file found, use FtpGetFile() (or FtpOpenFile()/InternetReadFile()) to download the
file.
If you're not using managed c++, then you should post your questions on the Visual C++/MFC board.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
|
Unless you've set the current/working directory, you'll need to append each found file name to
a path.
Maybe that's the problem??
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Armond Sarkisian wrote: Using the functions above, how would I be able to use a wildcare?
Armond Sarkisian wrote: I want to be able to grab all zip files from ftp://my_ftp/files/*.zip
Here's a basic example:
HINTERNET hInet = ::InternetOpen(NULL, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
HINTERNET hFTPSession = ::InternetConnect(hInet, _T("127.1.0.0"), INTERNET_DEFAULT_FTP_PORT, NULL, NULL, INTERNET_SERVICE_FTP, 0, 0);
WIN32_FIND_DATA FindData;
HINTERNET hFtpFind = ::FtpFindFirstFile(hFTPSession, _T("path\\*.zip"), &FindData, 0, 0);
if (hFtpFind)
{
do
{
TCHAR szFileName[MAX_PATH];
_tcscpy_s(szFileName, FindData.cFileName);
<font color="Red">
}
while (::InternetFindNextFile(hFtpFind, &FindData));
::InternetCloseHandle(hFtpFind);
}
else
{
DWORD dwError = GetLastError();
if(dwError == ERROR_NO_MORE_FILES)
{
}
else
{
}
}
::InternetCloseHandle(hFTPSession);
::InternetCloseHandle(hInet);
Info about the WinInet functions: WinInet Functions[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
What's the error?
if (FALSE == FtpGetFile( hFtpFind, szFileName, szFileName, 0, 0, FTP_TRANSFER_TYPE_BINARY, 0 ) )
{
geterror = GetLastError( );
<font color="Red">
}
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|