|
Andy H wrote: My question is this: How can I capture the tab key to also tab through the CToolbar buttons and also tab through the CDialog menu's?
AFAIK, there's no tab-through-buttons functionality in a toolbar (or am I wrong?).
Do you have a way to implement that functionality?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
You could just do it manually in whatever your message loop is (GetMessage, PeekMessage etc), by checking the MSG wParam to see if it's the tab key, then check to see if the message occurred in your Toolbar ctrl or your CDialog, and if so, tab to whatever you want.
KR
|
|
|
|
|
I have a MDI application which has a muliple dialog windows. One of these dialog windows needs to be update on regular basis. I am assume the best way to accomplish this is to add/create a OnTimer function and in it add code to refresh the window. What is the syntex for accomplish this.
<br />
void Lenze8200_Dlg::OnUpdate(CView* , LPARAM , CObject* )<br />
{<br />
Red_ON = AfxGetApp()->LoadIcon(IDI_RED_ON_LED); <br />
Red_OFF = AfxGetApp()->LoadIcon(IDI_RED_OFF_LED); <br />
Green_ON = AfxGetApp()->LoadIcon(IDI_GREEN_ON_LED); <br />
Green_OFF = AfxGetApp()->LoadIcon(IDI_GREEN_OFF_LED); <br />
Led_OFF = AfxGetApp()->LoadIcon(IDI_OFF_LED); <br />
<br />
if( G2MainApp.pitch_is_connected() == false ) <br />
{<br />
m_iconPitchConnected.SetIcon( Red_ON );<br />
}else{<br />
m_iconPitchConnected.SetIcon( Green_ON );<br />
}<br />
}<br />
<br />
<br />
<br />
<br />
void Lenze8200_Dlg::OnTimer(UINT nIDEvent)<br />
{<br />
<br />
CFormView::OnTimer(nIDEvent);<br />
}<br />
<br />
Scott Dolan
Jernie Corporation
Engineering & Manufacturing
Software, Hardware, & Enclosures
|
|
|
|
|
void Lenze8200_Dlg::OnTimer(UINT nIDEvent)
{
if (m_pDialog && ::IsWindow(m_pDialog->m_hWnd))
m_pDialog->RedrawWindow();
CFormView::OnTimer(nIDEvent);
}
|
|
|
|
|
Hans,
I get a compiler error when, i add this code. regarding &&. However, I might be because, i am not using the right object identify for m_pDialog. What should m_pDialog represent? How do find the name of the class i should use here
Where is it define in the project. MFC create the following classes for me.
MainFrm
ChildFrm
G2Motion
G2MotionDoc
G2MotionView
Scott Dolan
Jernie Corporation
Engineering & Manufacturing
Software, Hardware, & Enclosures
|
|
|
|
|
ScotDolan wrote: What should m_pDialog represent?
Sorry, I was not clear. m_pDialog = pointer to dialog that you created. Of course, the dialog may also be a class variable, so you could just say:
m_MyDialog.RedrawWindow();
Best wishes,
Hans
|
|
|
|
|
I'm invoking depends utility on one of the dll that I have developed and get the following error with a yellow? against the same
Error opening file. The system cannot find the file specified. This Error is coming against the modules MSVCP80D.dll MSVC80P.dll and DWMAPI.dll. What is the implication of this error.
Also the base window shows the following messages
Error: At least one required implicit or forwarded dependency was not found.
Warning: At least one delay-load dependency module was not found.
Error: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
|
|
|
|
|
Your DLL is built with debug libraries. Debug libraries do not exist on a machine, by default.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
I'm learning RPC (remote procedure call).
I included "rpcndr.h", and add "Rpcrt4.lib" in object/library modules. When compiling, I got the following errors:
Linking...
interface_c.obj : error LNK2001: unresolved external symbol _MIDL_user_free@4
interface_c.obj : error LNK2001: unresolved external symbol _MIDL_user_allocate@4
Debug/22_rpc.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
what am I missing? I am using VC6.0.
Thanks a lot for any help!
|
|
|
|
|
According to MSDN: The midl_user_allocate function is a procedure that must be supplied by developers of RPC applications. It allocates memory for the RPC stubs and library routines.
Example:
void __RPC_FAR * __RPC_USER midl_user_allocate(size_t cBytes)
{
return ((void __RPC_FAR *) malloc(cBytes));
} The midl_user_free function also must be written by the developer.
Example:
void __RPC_API midl_user_free(void __RPC_FAR * p)
{
free(p);
} Best wishes,
Hans
|
|
|
|
|
I see why it's called _user_ now. At first I thought it's my RpcRt4.lib which is not up-to-date.
Thank you very much, Hans.
|
|
|
|
|
What is the difference between VirtualAlloc and GlobalAlloc functions which are used to allocate memory from Heap. Also how is the heap management done given that there is no concept of Local and Global Heap.
|
|
|
|
|
|
|
Hello, does anybody ever tried to automate Excel in VC++ and want to show the autofilter programmatically? I tried Range.AutoFilter() function, however, I cannot make it work for me. I just want to get the drop-down arrow show up for me (similar to Data->AutoFilter menu in Excel).
Appreciate if anyone can direct me to a website which has more info on excel related application. Most of the sources I found is using either C# or VB, but limited info on C++.
Thanks a lot!
haiying
|
|
|
|
|
Hi, Can you please that Problem:
Maximum Clique Problem is a graph related NP-Complete problem. A Clique in an undirected graph G is a set of vertices V such that for every vertice pairs in V, there exists an edge connecting the two. Another definition of clique is given as the induced subgraph of V which is a complete graph. Also, Maximum Clique Problem is the corresponding optimization problem that is finding the the largest clique in a graph.
1) Find a subtle way to reduce Clique Problem to the Independent Set problem. (You should give the complexity of the transfer function in the report.)
2) Implement a software to solve the Maximum Clique Problem.
(You should give the complexity in the report.)
3) Implement a software which applies the appropriate transformation you have proposed and solves the problem as an instance of Maximum Independent Set problem.
(You should give the complexity in the report.)
Data and Test Runs:
Your software should be able to process any arbitrary graph which is represented by a NxN matrix in the input text file. A sample text file is provided within this project package (sample.txt). In this file, a value of 1 indicates the existence of an edge between vertex i and j. Your project will be tested both with this file and some other test files.
Kamrul Ahsan
Dept. of Computer Engg.
ITU,
Turkey
|
|
|
|
|
Sure, we'll be glad to help. Post the code you have so far, so we won't waste your time going over stuff you've already done.
|
|
|
|
|
Why does the following code result in a deadlock?
#include <windows.h>
#include <stdio.h>
#include <process.h>
unsigned __stdcall thread(void*)
{
while(1)
{
printf("t");
}
}
int main()
{
unsigned dwThreadId;
HANDLE hThread = (HANDLE) _beginthreadex(NULL, 0, thread, NULL, 0, &dwThreadId);
while(1)
{
SuspendThread(hThread);
printf(".");
ResumeThread(hThread);
}
return 0;
}
|
|
|
|
|
tom groezer wrote: Why does the following code result in a deadlock?
It depends on how ::printf() is implemented.
I assume it uses a critical section at some point to block other threads from messing up the memory while executing. If my assumption is correct, it's just a matter of time before your thread is suspended while inside the critical section and your main thread will be blocked when calling ::printf() resulting in a deadlock.
You should consider suspending a thread from another thread a serious bug since you have no idea in what state the other thread is in. If the thread that is suspended owns a critical section it may not be released and you'll get deadlocks.
Read this excellent article[^] to learn the basics of multithreading and to avoid common pitfalls.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
The handle must have the THREAD_SUSPEND_RESUME access right.
|
|
|
|
|
Hi every one
I am developing online jewellary shop site. It almost completed.
But i face one problem in my site there are 2 module 1 admin and 2 client.
now admin can add, delete and modify category and product and all the things which is available.
Now when ever i go to upload a new image of category or product at that time it is asking about username and password.
I am giving u My site URL and ID,Password and also full path pls follow it u will see practicly there
http://www.sarconsultancy.com/ddgadmin/
go here there id and password is 'admin/admin' both same
after login u will see Admin Home Click on Catelog
Now u will see 'category' page. click on 'Edit Image link' then 'browse' and select an Image and try to save it. u will see the dialog box which is asking for a username and password
now my question is why it is happening
i found that i have to set the permission of physical folder i also tried to set permission like 777, 750, and all the possibility but when i save and close smart ftp then it will be reset. means it becomes 0 again.
I am using Smart FTP Client if u know how to set the permission for physical folder on remote machine pls tell me totally process
Thanks
I am wating your reply
TarDuk - A Memory Beyond The Life.
|
|
|
|
|
in my application,i want to disable the f1 key.
when clicking f1 key on my application it will show the error message as cant find help file.
how to hide this.
My need is :
When i press f1 key nothing going to happen hoe to this.
I tried the following but not success
in Pretranslatemessge()
case VK_F1:
return TRUE;
|
|
|
|
|
prathuraj wrote: I tried the following but not success
in Pretranslatemessge()
case VK_F1:
return TRUE;
Why are you after that poor function? It walks all through MFC class hierarchy and it is a low level function. Don't mess with it.
Handle OnHelpInfo() (right click on your dialog in design mode, click events, then add a handler for WM_HELPINFO...)
BOOL CMyDlg::OnHelpInfo(HELPINFO* pHelpInfo)
{
AfxMessageBox("Help called");
return false;
}
"The difficulty lies, not in the new ideas, but in escaping from the old ones."
-- John Maynard Keyes, 1936
|
|
|
|
|
|
Sometimes The Intellisense of my VC++ Editor disappears- I am using Microsoft's Visual Studio 6.0
So when i try to put a . the popdown menu is not displayed .. .
Any solutions????
Proud To Be an Indian
|
|
|
|