|
im trying to do some excel automation but im getting that _com_dispatch_method is undefined, im using MFC, any idea why?
|
|
|
|
|
Did you call AfxOleInit or CoInitialize before any automation code?
Bunburry
|
|
|
|
|
yes, but i doesn´t even compile i get that linker error
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
[^]
|
|
|
|
|
#include <atlcom.h>
#include <comdef.h>
does this help compiling?
Bunburry
|
|
|
|
|
¿?
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
[^]
|
|
|
|
|
sorry if forgot the <> tags
So again:
#include <atlcom.h>
#include <comdef.h>
Bunburry
|
|
|
|
|
Nope Still the Same
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
[^]
|
|
|
|
|
my last idea:
#include <comutil.h>
Bunburry
|
|
|
|
|
nope still the same
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
[^]
|
|
|
|
|
Try uncommenting COM related code snippets, try figure out which part causes this
Bunburry
|
|
|
|
|
i will thanks a lot
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
[^]
|
|
|
|
|
hi, i found the solution this weekend , i just needed to add comsuppw.lib ,
thanks for all your help
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
[^]
|
|
|
|
|
OK so this is kind annoying:
I have a an environment varialbe that I want added to the Users env vars, and tehn appended to the Users Path.
So I modify the HKEY_CURRENT_USER\Environment and add a value called FOO, that equals "c:\tmp\crap".
I then modify the path value and add "%FOO%" to the beginning of the string.
I close regedit.
Now I run a small program that does the following:
DWORD res = 0;
DWORD res2 = SendMessageTimeout( HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)"Environment", SMTO_ABORTIFHUNG, 5000, &res );
if ( !res2 ) {
char tmp[256];
sprintf( tmp, "SendMessageTimeout error: %d", GetLastError() );
MessageBox( NULL, tmp, "Error", MB_OK );
}
else {
char tmp[256];
sprintf( tmp, "SendMessageTimeout res: %d", res );
MessageBox( NULL, tmp, "SendMessageTimeout lpdwResult", MB_OK );
}
I open the System properties adn sure enough a new env var has been added (FOO=C:\tmp\crap), and path now has the %FOO% value, expanded to "c:\tmp\crap".
I open a command prompt and type path:
Alas it does NOT see the expanded FOO value, and instead only prints out %FOO% (plus the rest of the path).
I had thought the problem might be with the installer, which performs these same steps. So I tried the above manually with regedit and running the little refresher program manually.
Obviously I am doing something stupid but I cannot find out what, nor has googling for this proved enlightening, other than to provide countless examples of the above code that *should* work.
The ultimate point of course, is to have some executable (a command line program) that would be located in the directory pointed to by FOO, and then be able to run it from the command line. This, so far, has not worked without rebooting.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
My first guess would be that you have too many environment variables, or those that you do have are too large. To test this theory, remove one of the longer ones and see if FOO and PATH show up properly.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Nope, no dice.
Still doesn't work.
I even tried clearingthe whole path. And made sure both were REG_EXPAND_SZ types.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
Not that it matters, but I don't think that FOO needs to be REG_EXPAND_SZ type as there is nothing to expand.
I am able to reproduce the problem. Sometimes it works and sometimes it doesn't. The amount of time I wait after changing the variable but before opening a command prompt does not seem to matter. When I removed a few of my environment variables earlier, it was showing up correctly. Now it seems to be intermittent.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
The one thing I found stated that programs don't have to process te WM_SETTINGSCHANGE message. If they do they return 0. Even if they do process there is no guarantee they will handle it correctly ( I love this, it just keeps getting better).
The solution proposed was to insert some kind of crazy system hook to "fix" this, but in the case of env variables I really don't understand what you'd do.
I would desparately love to solve this. Obviously programs like the DevStudio installer handle this (though you do end up rebooting, so maybe they don't handle it correctly after all)?
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
I want to make an MFC? app containing an edit box similar to the command line that can:
1. add a prompt on every line
2. notify parent on 'enter'
3. inhibit edit on all but the current line
Is there anyone who knows of anything existing or have an idea of how to achieve the above?
|
|
|
|
|
Sound like a typical CView window.
Kuphryn
|
|
|
|
|
so how do I accomplish it with the CView?
|
|
|
|
|
I have ben using 3rd party ActiveX controls on my dialog
based application. I have used the Tabbed dialog class
CMyTabCtrl - from codeproject - (6 dialogs in total).
All is fine apart from dialog 4 (tab 4), I keep getting an
Debug Assertion Error when I refer to any member variables
associated to any controls on this tab.
I thought is was just with the 3rd party ActiveX controls,
but it occures with a member variable tied to a standard
Windows button.
The variables are all NULL {000000} and I dont understand
why. I have deleted and replaced some of the controls, but
get the same error.
The use of member variables on other dialogs (tabs) are
OK - they work fine.
I dont want to restart this project as a lot of work has
gone into it.
Any idears out there?
|
|
|
|
|
Humm...
As you didn't post any code, consider doing some cross-reference checking. See what variables and functions you have in one of the dialogs (Not #4) and then compare the way you create this dialog to that of #4's.
Basically, see the logic behind all your dialogs: how do they work, how are they called. Then see how the ones which work differ from #4.
Last resort is to attach the debugger and step through the code to see what ASSERT command causes the assertion. This assumes that you have MFC Source Code installed. If you don't, then guessing and testing is the best way to go.
Perhaps you would post some code here ? I assume the Tabbed dialog is a self-standing class and the control forms (tab views) are members of this class ?
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Thanks for your post.
The assertion error occures as soon as I make referecnce to any of the controls member variables.
It seems that the dialog is not being initialsed, but I can see no difference in this tabbed dialog than all the others.
|
|
|
|
|
Has anyone managed to get tear-off menus working in Windows (other than with the GTK, I mean!)
It would be possible to have a menu item with a line of dashes as its caption. It would be possible to make that item open a new window. But: is it possible to make that new window contain a fully-opened copy of an arbitrary HMENU?
You could make the "tear here" menu item open a copy of its own menu as a TrackPopupMenu item, but the popup menus only last for one mouseclick, and you can't drag them around like a window.
Those are just a couple of ideas, neither of which really works properly yet: are there more reliable ways of having tear-off menus?
|
|
|
|
|
please don't ...
the tear-off menus are one of the ugliest UI "feature" ever done; they were meant, I think, to replace toolbars functionalities.
I suggest you try implementing toolbars, and customizable toolbars ( to add/remove buttons ) instead.
but if you really want to, one way would be to create a palette-like window with buttons that represent the menu items.
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|