|
MFC translates F1 into ID_HELP command. You're invoking Html help in response to what event?
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Thanks for the fast response. I'm invoking Html Help in response to menu item File->Keys. And I assign F1 as the accelerator key to this menu item.
I add the following lines to my dialog cpp in its message map declaration:
ON_COMMAND(ID_HELP, OnFileKeys)
And remove the line for ID_HELP in the App class.
Thus solved the problem.
Thank you very much again!
|
|
|
|
|
is it possible to use the RASDial Function without knowing the
szEntryName + password + username, and just connect with the
default settings to redial a lost Modem connection .
thanks
|
|
|
|
|
|
According to my experiences and some sources on the net the MFC class CSocket does not seem to be very thread-safe.
Creating the sockets (listen sockets & accepted sockets) in the main-thread and using them in another thread gives troubles...
So I tried to create all sockets in the thread function.
After calling AfxSocketInit() in the thread function (I don't know if this is correct ...) Everything seems to be fine, But the virtual functions OnAccept(), OnReceive(), ... are not called.
The attach/detach trick is not an option, because both mainthread and other thread use the sockets.
How should I handle this problem ?
Any help appreciated.
Greetings,
Niko
|
|
|
|
|
Why can you not use Attach/Detach? I use this in a multi-threaded socket app.
e.g. I have a thread that uses a socket that listens on a port. When an incoming connection arrives it creates a new thread and passes the thread the socket handle:
void CListenSocket::OnAccept(int nErrorCode)
{
CSocket socket;
Accept(socket);
CAcceptThread* pThread = (CAcceptThread*)AfxBeginThread(
RUNTIME_CLASS(CAcceptThread),
THREAD_PRIORITY_NORMAL,
0,
CREATE_SUSPENDED);
pThread->m_hSocket = socket.Detach();
pThread->ResumeThread();
}
BOOL CAcceptThread::InitInstance()
{
m_pSocket = new CServiceClientSocket;
m_pSocket->Attach(m_hSocket);
}
Faith. Believing in something you *know* isn't true.
|
|
|
|
|
We don't want to use many thread, because there will be some 10.000 connections on that server. The accepted connection is added to a pool.
1 thread polls all connections and performs some actions on the sockets.
On the same time the main thread is also able to do some interaction on some sockets.
I guess using attach/detach everytime when needed wouldn't be good idea.
|
|
|
|
|
one of my costumers has the problem that my program
is crashing when he starts up the program. he has
send me the cpu/memory adresses of the standard
warning window when a program is crashing.
how do i find the problem causing the program to crash
on his maschine with the information i have now ?
Regards
mario
|
|
|
|
|
|
|
fheyn wrote:
check the dll's
My dll's are fine, thanks.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
1) Copy Dependency Walker (Depends.exe) to a floppy.
2) Find out his OS version.
3) Go to a computer with that OS and your application installed.
4) Copy Depends.exe to that machine and run it.
5) Open the app that caused the error (MyApp.exe caused an invalild page fault...) in depends
6) In the bottom panel, find the base address of the module the error occured in
7) In calc.exe, subtract the base address from the memory address of the error
8) Sort column 2 row 2 panel in depends by the Entry Point column
9) Find the closest match to your calculated result in #7 in the entry point column
10)This address should correspond with the function your error occured in (look in the function column)
Its not perfect, but it works most of the time.
Jason Henderson quasi-homepage articles "Like it or not, I'm right!"
|
|
|
|
|
thanks a lot, i will try this!
|
|
|
|
|
Who have the source code about chart of the stock?
Please help me! Thanks a lot!
|
|
|
|
|
How can I runtime change the height of the vertical scrollbar.
For example, so that the size of a thumb corresponded to the ratio of the all lines to the quantity seen on the screen.
Best regards,
Eugene Pustovoyt
|
|
|
|
|
Use SetScrollInfo. nPage member of SCROLLINFO controls the size of proportional scroll thumb.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Thank you, very much!!!
Best regards,
Eugene Pustovoyt
|
|
|
|
|
I have a member function which needs to return a CString& , and within that function I have the return value in a CString object. Can anyone tell me how I can return my CString as a CString& ?
Dylan Kenneally
London, UK
|
|
|
|
|
You can't, unless you make your variable static or member.
If this is local variable, it's destroyed when your function returns and reference is no longer valid - it'll point to stack space which is unused/used by different function.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
You should do as such:
CString str = "ok";
MyFunction( str );
...
...
// str value is now "test"
void MyFunction( CString& str )
{
str = "test";
}
What happens here is that you pass str as a reference (it's adress instead of it's value). So when the function ends, the variable is still valid since it wasn't create within the function scope.
Hope it helps!
---------------
http://www.edovia.com
|
|
|
|
|
I'm working a project on oracle8.06. To export data in oracle to .dbf in Visual foxpro6.0,i create ADOConnection
and ADORecordset.However,i don't know how to set para in
ADOConnection->open() and ADORecordset.I find vfpodbc.dll
instead of vfpole.dll. Does it work in ado?
Every time i call ADORecordset->open(),The "3105 error"will appear.How do i solve it,Please?
Thanks.
|
|
|
|
|
I need to format the data before showing it in MS Data Grid bound to a database.
I have spent a lot of time on this but to no avail.
Any help will be appreciated.
Ammar
There is a difference in knowing the path and walking the path.
|
|
|
|
|
Can anyone recommend a good tool for formatting C++ source/header files. ie. fixing tabs, etc. I do the Alt F8 thing but it means I have to actually open every file. Does Visual C++ have some hidden standalone exe that does this?
|
|
|
|
|
maybe to much work but get UltraEdit32 and write a Makro - it's easy (I used UltraEdit32 for some other reasons - dataconversion from unix to w32 and such stuff and the makro-section is really easy to use)
flo
I don't want achieve immortality through my work - I want achieve it through not dying - Woody Allen
|
|
|
|
|
I have the following problem: I dynamically create the items of a CTabCtrls and switch the option "MultiLine" on in ResourceEditor. When adding a new item I don't know how to handle the SetWindowPos correctly of the new items. as long as there is just one line of items i can see my inserted dialogs perfectly but if the tabctrl adds a new row (multiline) i cant see the second row because over the second row there is the item displayed. i tried to determine the rowcount by GetRowCount but this doesn't work, although I switch the Multiline-Option on. I also tried to put an additional ModifyStyle(0,TCS_MULTILINE), but this delivers only 0.
Has anybody an idea how to solve my problem.
thanks a lot in advance
flo
I don't want achieve immortality through my work - I want achieve it through not dying - Woody Allen
|
|
|
|