|
Hi Anthony,
no that function is not called anywhere in the project.
Is it needed? I can't find any documentation about it other than what I found in msdn:
Remarks
Initializes the OLE DLLs.
MSDN you suck!
anyways, I tried adding a call to AfxOleInit() but all it did was make an assertion fail. When I looked into this I found out that it was checking to see if AfxOleInit() has been called twice. So even though the function call doesn't appear in any of MY code, the framework seems to have called the function for me behind the scenes.
See Ask Dr. GUI #57[^]
so yeah I still can't figure out how to get the event handler to work.
|
|
|
|
|
The control will send the notification to it's parent window (the dialog bar).
You could put a trace for it in the dlg bar's PreTranslateMessage, just to check what's happening, or use SPY++ to spy on the dialog bar.
Steve S
|
|
|
|
|
Hey Steve,
With your help I finally got this damn thing to work
Since the CDialogBar class (the one that was created in the OnCreate method of the CMainFrame class) was getting my messages I replaced it with a class of my own derived from CDialogBar and added my message map and eventsink map and it works now.
Here's an even harder question: why in the hell did microsoft make me jump through that many hoops just to use a bloody activeX control in a toolbar? Isn't there an easier way?
thanks,
-Oinka
Microsft Sucks!
|
|
|
|
|
Hello Gurus,
Does anyone know how to link multiple Access tables programmatically. Tables are located in 2 different databases.
I am using VC++ 6.0 / MFC.
Thanks,
Dmitry
|
|
|
|
|
In what way do you need them linked?
You could try creating temporary tables to store fields from both databases.
|
|
|
|
|
I need to link the tables in order to run an update query on one database.
I am writing a tool that allows a user to set up mappings (fields in database1 map to fields in database2 based on certain conditions). The tool then creates an update query that joins tables from both databases and updates certain fields in database1. Since the tool may be run on different databases, I do not know in advance which tables will have to be linked.
Thanks.
Make things as simple as possible, but no simpler. -- Albert Einstein
|
|
|
|
|
Hi,
Does anyone know a good tutorial on keyboard accels, or does anyone want to give sime kind of lesson about it (like a checklist or something).
My problem is like this:
I have an app wich shows pictures, this works.
But every time a user presses the right-arrow button, the app needs to show a new picture (this is done by calling showNextPicture()).
I've already build showNextPicture(), but I can't build the link between the key and the function.
PS I'm using a dialog based app, with MFC support
Thanks for reading this!
|
|
|
|
|
Look at PreTranslateMessage() and TranslateMessage() in your docs. It will point you to where you can determine what key was pressed and from there what handler to call.
|
|
|
|
|
OK, I've read it,
But Is still don't understand what exactly I've got to do with those messages etc. can you explain that to me?
|
|
|
|
|
Add a menu option like ID_SHOW_NEXT, make this call your function, then map the arrow key to your menu option in the accelerator resource.
Steve S
|
|
|
|
|
Hi there,
I've downloaded a tutorial from thecodeproject about tcp servers, and it contains the following code:
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])<br />
{<br />
int nRetCode = 0; <br />
<br />
cout << "Press ESCAPE to terminate program\r\n";<br />
AfxBeginThread(ServerThread,0);<br />
while(_getch()!=27);<br />
<br />
return nRetCode;<br />
}
and this
<br />
UINT ServerThread(LPVOID pParam)<br />
{<br />
return 0;<br />
}<br />
I've copied the code into a neat console app with mfc functionality, but this isn't compiling.
How is this possible?
|
|
|
|
|
|
Do I hvae to define ServerThread before it's call (I'm not used to that)?
I'll try it, and if it works thank you a lot!!!
|
|
|
|
|
BoudewijnEctor wrote:
Do I hvae to define ServerThread before it's call (I'm not used to that)?
No, but you do have to declare it.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Firstly, I am sorry if this is in the wrong area but I am looking for a way to create an ActiveX control that I can include in my ASP page for using MS's TemplatePrinter functionality. Here is the site at MSDN
I need to call IOleCommandTarget:Exec, but I'm confused on how to set this up. Does anyone have experience with this?
Thanks,
Nate
|
|
|
|
|
Hi
I am getting this error on making a diaolag box.
Actually i am making a tab control and i just designed a few boxes and i received this error. I have started over and over again but again i get this error . please help me on how do i get rid of this kind of error.
HC1002: Note:
Using existing phrase table: Gui.ph
HC3025: Warning: topic #1 of C:\Program Files\Microsoft Visual Studio\MyProjects\SidsteUdkald\hlp\.\afxcore.rtf
Jump to undefined Topic ID: "menu_record".
HC3025: Warning: topic #3 of C:\Program Files\Microsoft Visual Studio\MyProjects\SidsteUdkald\hlp\.\afxcore.rtf
Jump to undefined Topic ID: "HID_OLE_EDIT_LINKS".
HC3025: Warning: topic #3 of C:\Program Files\Microsoft Visual Studio\MyProjects\SidsteUdkald\hlp\.\afxcore.rtf
Jump to undefined Topic ID: "HID_EDIT_PASTE_LINK".
HC3025: Warning: topic #3 of CC:\Program Files\Microsoft Visual Studio\MyProjects\SidsteUdkald\hlp\.\afxcore.rtf
Jump to undefined Topic ID: "HID_OLE_INSERT_NEW".
HC1010: Note:
The following mapped Topic IDs were not used in any topic:
AFX_HIDP_UNREG_DONE
AFX_HIDP_GET_NOT_SUPPORTED
HID_HT_OBJECT
.
.
.
.
and it continues to a long listtttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt.
Thanks in advance.
|
|
|
|
|
It's from the help compiler. Are you making a help file? If not, you can just remove the dependency from your application.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi david
yes i making the conext sensitive help.
I dont know why is this kind of error coming up .
It was ok a few days back.
How do i remove the "dependancy" from my application ?
Please elaborate.
Thanks for replying.
-----------
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
Five are left . They have "decided to fly off" and havent actually flown away yet.
|
|
|
|
|
help_me_pleeze wrote:
How do i remove the "dependancy" from my application ?
I believe you handle that in the Project Dependencies dialog box.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
there is nothing in the dependancy . the field is empty.
What else could be wrong ?
thanks.
|
|
|
|
|
help_me_pleeze wrote:
What else could be wrong ?
Not sure, as that is the only place I've ever needed to look. Is this VS6 or VS.NET?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
It is visual Studio 6.
Thanks.
|
|
|
|
|
Hello,
I am trying to write a simple little oo windowing library for opengl (mainly a wrapper for the c based windowing code); of course i had the standard wndproc callback as a class member problem, but i found a way around that, what i did was simple enough, i made WndProc static, but that meant i couldn't get at class members and then I noticed that the last paramater of CreateWindowEx was passed as the LPARAM of your wndproc callback on WM_CREATE. So, i passed 'this':
CreateWindowEx(blah...., this);
then in WM_CREATE:
SetWindowLong(hWnd, DWL_USER, lParam);
then whenever i have a WM_* callback i acces my class through
((MyClass*)GetWindowLong(hWnd, DWL_USER))->junkMyClassPointsTo...
but CreateWindowEx is always failing, none of the paramaters are bad, the only thing i can think of is 'this' and i don't know if WndProc-WM_CREATE is called then and if it is what is giving me the problem.
if anyone could help me with this, it would be most appreciated.
thank you,
-Matt
|
|
|
|
|
sorry, just to add on, i have also used GWL_USERDATA instead of DWL_USER if that makes a difference, thanks
|
|
|
|
|
Try this article.[^]
"We have done so much in the last 2 years, and it doesn't happen by standing around with your finger in your ear, hoping everyone thinks that that's nice." - Donald Rumsfeld
|
|
|
|