|
Alex,
I got your response via email, but it doesn't seem to be on the board (bug Chris/Uwe)?
It sounded from the tone of your email that you'd found a solution; have you?
Even though MVS supports a different file naming convention, the FTP server implementation is still responsible to display directories in the standard FTP (Unix) format. The FTP server under Windows has the ability to display directories in MS-DOS or Unix format, but if you set it to anything other than Unix, none of the Windows (automated) ftp programs will work correctly.
So, I think you've got two choices. a) try and figure out how to get your MVS system to display directories the correct way (there may be a command you can enter), or b) get some FTP sourcecode and start making some customizations.
I think everyone knows that we sell the Dundas TCP/IP source code, but if you are not worried about licensing issues, warranties, etc., you might have a look at some of the free code available here and at CodeGuru.
Someone correct me if I'm wrong, but I think PJ's ftp stuff is written to use the Wininet stuff (which CFTPConnection wraps).
Hope that helps.
|
|
|
|
|
Hi!
i'm loking to unrar archives in my own program but i don't know how to do, i downloaded somes files from rarsoft.com but it seems to miss rar.lib.
who can help me ?
|
|
|
|
|
I have been using PowerArchiver 2000. It is a knock off of Winzip and can handle numerous file types.
|
|
|
|
|
Hi
I've created one mfc based application that hosts microsoft's WebBrowser control on windows 98. but when i try to run it, it hangs. i did some research and found out that if i have internet explorer version 5.5 on win 98, then it works fine but if you don't have ie 5.5, then it hangs.
Is there any way i can get an old version of MS WebBrowser control so that it doesn't require ie 5.5? Is there any other way i fix this problem.
I would really appreciate ur help.
Thanks
Parvesh
|
|
|
|
|
Hi, I have a few questions about Multi-threading with MFC.
1. With the function you supply in the first parameter of AfxBeginThread, - the new thread calls this function- if you have multiple threads calling this function, is a new instance of the function created or is it used by all threads? ie
AfxBeginThread( UpdateClients, this )
If you create 3 threads, do these 3 threads all share
the same instance of UpdateClients? Wouldn't make a lot
of sense if they did...but just curious.
2. I'm creating a client/server application which has
basic transfer/sending capabilities. I was intending to create a seperate thread for each dialog box used to indicate how much a file has been sent/receive. What is the best method for doing this? Should I use CWinThread?
The tutorials for using GUI threads confused me more.
Thanks for your Help
|
|
|
|
|
Andrew:
A couple of pointers:
1. A function doesn't really have an "instance" in the way a variable does. All threads calling a function are invoking the same code -- Windows doesn't keep multiple copies of the code in memory. Each thread does have its own call stack -- which tracks the state of the program-execution for that thread. Lastly, note that if the function has a static variable declared within, that variable will be shared between threads unless it is set to use thread-local storage.
2. You _can_ have your dialogs running on other threads, and CWinThread is a fine way to achieve this. However, I would consider keeping the GUI elements on the main thread and placing your processing code on another. In this case, your dialogs can simply be modeless and query the worker thread they are associated with for a periodic status update. Either way will work, and it's debatable what is a "better" solution. Personally, I like to keep the GUI on one thread, esp. if I'm using MFC.
Regards,
Nick Hodapp
|
|
|
|
|
Hello,
I am sorry to disturb you too much but i am really confused about the system-wide hooks. I am now using a DLL to catch all keyboard events, as Michael Dunn said. But again it works only with my program. Here is the source code:
<br />
*********************SystemHook.h**********************<br />
#ifdef SYSTEMHOOK_EXPORTS<br />
#define SYSTEMHOOK_API __declspec(dllexport)<br />
#else<br />
#define SYSTEMHOOK_API __declspec(dllimport)<br />
#endif<br />
<br />
class SYSTEMHOOK_API CSystemHook {<br />
public:<br />
CSystemHook(void);<br />
};<br />
SYSTEMHOOK_API LRESULT CALLBACK KeyboardProc(int code,WPARAM wParam,LPARAM lParam);<br />
SYSTEMHOOK_API int WINAPI InstallHook (HWND hWnd, BOOL bCode );<br />
*******************************************************<br />
<br />
*********************SystemHook.cpp**********************<br />
#include "stdafx.h"<br />
#include "SystemHook.h"<br />
<br />
#define ID_CMD_KEYPRESSED WM_USER+200<br />
<br />
HWND ghWndMain;
<br />
static HHOOK hHook;
static BOOL bHookInstalled;
<br />
HINSTANCE ghDLLInst;
<br />
BOOL APIENTRY DllMain( HANDLE hModule, <br />
DWORD ul_reason_for_call, <br />
LPVOID lpReserved<br />
)<br />
{<br />
switch (ul_reason_for_call)<br />
{<br />
case DLL_PROCESS_ATTACH:<br />
case DLL_THREAD_ATTACH:<br />
case DLL_THREAD_DETACH:<br />
case DLL_PROCESS_DETACH:<br />
break;<br />
}<br />
ghDLLInst=(HINSTANCE)hModule;<br />
return TRUE;<br />
}<br />
<br />
CSystemHook::CSystemHook()<br />
{ <br />
return; <br />
}<br />
<br />
SYSTEMHOOK_API LRESULT CALLBACK KeyboardProc(<br />
int code,
WPARAM wParam,
LPARAM lParam)
{<br />
if ( code >= 0 ) <br />
{ <br />
if (GetKeyState(VK_SHIFT) < 0 && GetKeyState(VK_CONTROL) < 0) <br />
{ <br />
switch (wParam) <br />
{ <br />
case VK_F9:<br />
if (HIWORD(lParam) & 0x8000) <br />
PostMessage(ghWndMain, WM_COMMAND, ID_CMD_KEYPRESSED, 0L);<br />
return 1;<br />
} <br />
}<br />
}<br />
return (int)CallNextHookEx(hHook, code, wParam, lParam); <br />
}<br />
<br />
SYSTEMHOOK_API int WINAPI InstallHook (HWND hWnd, BOOL bCode )<br />
{ <br />
int nReturn = 1;<br />
ghWndMain = hWnd;
<br />
if (bCode == bHookInstalled) <br />
return 0; <br />
<br />
if (bCode) <br />
{ <br />
hHook=(HHOOK)SetWindowsHookEx(WH_KEYBOARD,(HOOKPROC)KeyboardProc,ghDLLInst,0); <br />
if (!hHook) <br />
return 0; <br />
bHookInstalled = TRUE; <br />
} <br />
else <br />
{ <br />
nReturn = UnhookWindowsHookEx(hHook); <br />
bHookInstalled = FALSE; <br />
} <br />
return nReturn; <br />
}<br />
*******************************************************<br />
Then in my main view:
<br />
void CWinSchedulerView::OnInitialUpdate() <br />
{<br />
CFormView::OnInitialUpdate();<br />
InstallHook(m_hWnd,TRUE);<br />
}<br />
void CWinSchedulerView::OnDestroy() <br />
{<br />
CFormView::OnDestroy();<br />
InstallHook(m_hWnd,FALSE);<br />
}<br />
<br />
BOOL CWinSchedulerView::OnCommand(WPARAM wParam, LPARAM lParam) <br />
{<br />
if(wParam==ID_CMD_KEYPRESSED)<br />
MessageBox("Ctrl+Shift+F9");<br />
<br />
return CFormView::OnCommand(wParam, lParam);<br />
}<br />
This works only on my window.If i press ctrl+shift+f9 on another window, it does not work.
Thanks for any helps in advance.
Mustafa Demirhan
|
|
|
|
|
At least shared data should be in a shared/readable/writeable section. Following a working code sample.
|
|
|
|
|
I'm searching around, for quite a while, for a function, that would be able to execute PE executable once it was loaded into memory (for example with CMemFile).
I would be very gratefull if someone would write article or give away some source code (Matt Pietrek where r u...?
|
|
|
|
|
May be no one has written such a such except what is in the OS, or may be it's too critical to their bussiness
to share.
Here are some of what I know:
1) You can't use memory-mapped file as a basically for PE execution, because PE file is normally stored using
512-byte block size, when in-memory image uses 4096-block size.
2) Simulate what LoadLibrary will do for a PE file.
3) Shut-down or make current process to be minimal and jump to the entry point of loaded EXE.
4) Debug in assembly code.
|
|
|
|
|
Since my post I have found some samples around this theme in virus community, the only problem is that all c++ sources are so hardly crippled that correcting them would mean to study thema so well i wouldn need that source any more This life sucks
|
|
|
|
|
How can I get a standard yesno messagebox to display in Spanish (Si/No) ?
I'm using Visual C++ Version 1.52 16-bit which doesn't support the messageboxex function.
|
|
|
|
|
i downloaded the program aimster, and has an interesting feature, as it interacts with AOL IM, it gets the buddy list, and if u click on it, it opens a AOL im window. It basically sends messages to the AOL IM application. How does it do this, does it use, FindWindow, then SendMessage, and sendtext to the AOL instant messanger app? How does it know AOL IM is running. Does anyone know how this works.
|
|
|
|
|
You've got some reading to do
Sending messages to another Window isn't a problem, you just have to figure out which messages you need to send. I don't know aimster, and I've not dug into the AOL's IM, but it should be pretty straightforward to figure out if a) AOL IM offers an API to automate the use of its messaging (which I think would be a good move for them), or b) which message ID's trigger which functions.
Problem with mapping to undocumented stuff is that it can change, which makes for unstable software. What I'm getting at here is that you might be able to 'hack' AOL IM for the current version, but there's no guarantee that all versions of AOL IM use the same messages, or that they will use the same messages in the future.
In any event, there are a few ways to enumerate the applications running on your system, depending on whether you are interested in Windowed and/or Windowless applications. A good place to start however is with the EnumWindows() Win32 API function, and you'll see links to Process and Thread functions that preform similar functions.
|
|
|
|
|
I am in trouble with hooks. I have entered the following code to my programs main view's .cpp file:
<br />
HHOOK m_hhk;<br />
static LRESULT CALLBACK KeyboardProc(int code,WPARAM wParam,LPARAM lParam);<br />
<br />
void CWinSchedulerView::OnInitialUpdate() <br />
{<br />
CFormView::OnInitialUpdate();<br />
m_hhk = SetWindowsHookEx(WH_KEYBOARD,(HOOKPROC)KeyboardProc,NULL,GetCurrentThreadId());<br />
}<br />
<br />
static LRESULT CALLBACK KeyboardProc(<br />
int code,
WPARAM wParam,
LPARAM lParam)
{<br />
if (code < 0 || code != HC_ACTION)<br />
return CallNextHookEx(m_hhk, code, wParam, lParam);<br />
if (wParam == VK_F1)<br />
{<br />
AfxMessageBox("F1");<br />
}<br />
return CallNextHookEx(m_hhk, code, wParam, lParam);<br />
}<br />
<br />
void CWinSchedulerView::OnDestroy() <br />
{<br />
CFormView::OnDestroy();<br />
<br />
UnhookWindowsHookEx(m_hhk); <br />
}<br />
Well, this works well if i press F1 wheh the active window is my window. However, when i press F1 on another window it does not work. If someone tell me the problem, i will be very glad.
Thanks in advance for any helps
Mustafa Demirhan
|
|
|
|
|
Becuase you're only installing the hook for your app's thread (see the last param of SetWindowsHookEx() ).
If you want a system-wide hook, pass 0 for the thread ID. However, for system-wide hooks, the hook proc must be in a DLL. MSDN goes into depth on this - check out the docs.
|
|
|
|
|
I looked at your question in the CodeGuru web site and I tried to look at it closely. I saw no evidence there that you wanted a system-wide hook, sorry. If I had known you are trying to do a system-wide hook I would have said something there.
For best results, though, you will need to spend more time reading.
|
|
|
|
|
I guess it was not the CodeGuru web site; I guess it was your other question in this web site.
|
|
|
|
|
i have no idea but i wanna create a site with frames i used dreamweaver and like 10 other html programs, no luck yet i have no idea what to do
|
|
|
|
|
see http://planetwebdesign.com/frames.htm for samples
you can also do a internet search for
html frames
many examples should come up
|
|
|
|
|
I have tried to add a cstatic control to display a bitmap.
the background is made transparent (by using the grey color). it really appears to be transparent in my computer. But when i deploy the program in another person's computer, the background becomes not transaprent (becomes darker). Why is that?
Thanks all!
|
|
|
|
|
Hello,
I am trying to use hooks to get all keyboard events but i could not achieve to compile my code. Here is the code:
<br />
LRESULT CALLBACK CWinSchedulerView::KeyboardProc(<br />
int code,
WPARAM wParam,
LPARAM lParam)
{<br />
if (code < 0 || code != HC_ACTION)<br />
return CallNextHookEx(m_hhk, code, wParam, lParam);<br />
if (wParam == VK_F1)<br />
{<br />
MessageBox("F1 is pressed!");<br />
}<br />
return CallNextHookEx(m_hhk, code, wParam, lParam);<br />
}<br />
<br />
void CWinSchedulerView::OnDestroy() <br />
{<br />
CFormView::OnDestroy();<br />
UnhookWindowsHookEx(m_hhk); <br />
}<br />
This code is compiled with no errors. However at InitDialog() the following code gives error:
<br />
HOOKPROC lpfn = MakeProcInstance(KeyboardProc, hInst);<br />
m_hhk = SetWindowsHookEx(WH_KEYBOARD,lpfn,NULL, GetCurrentThreadId());<br />
I know that MakeProcInstance is obselete in Win32. So I tried the following:
<br />
m_hhk = SetWindowsHookEx(WH_KEYBOARD,(HOOKPROC)KeyboardProc,NULL, GetCurrentThreadId());<br />
But, this cannot be compiled to. The error is same:
<br />
D:\Visual C++ Projects\WinScheduler\WinSchedulerView.cpp(216) : error C2440: 'initializing' : cannot convert from '' to 'long (__stdcall *)(int,unsigned int,long)'<br />
None of the functions with this name in scope match the target type<br />
I think i cannot give the function pointer correctly. How can i correct this error?
Thanks in advance for any help.
Mustafa Demirhan
|
|
|
|
|
Is KeyboardProc a static member of CWinSchedulerView? It must be.
|
|
|
|
|
I got this error message too. Instead of using the KeyboardProc function as a member
function of your CWinSchedulerView class, you should define it as:
static LRESULT CALLBACK KeyboardProc (int code, WPARAM wParam, LPARAM lParam);
-------------------------------------------
Marcelo Guerra
|
|
|
|
|
Using VC++ 6 ?
How can i create user interface like MS Money.
Thanks in advance
Pankaj
|
|
|
|
|