|
Which version of AutoCAD do you have installed?
LT does not support VB.
|
|
|
|
|
It works!
(I had to write "CreateObject("AutoCAD.Application")" )
Thank you!
|
|
|
|
|
Do you know what's happening when autocad is closed en there is not a active document?
When I try it, nothing happened. And when I open autocad later, my program doesn't draw anything
|
|
|
|
|
When I save the drawing, I see my drawing where I saved it. Autocad is opened, but I can't see it. I have to end the task, and then I openened my saved drawing, and then I see it.
And there is also something strange,
MsgBox "now the document"
Dim acadDoc As AcadDocument
Set acadDoc = acadApp.ActiveDocument
MsgBox "the active document is: " + acadApp.ActiveDocument
I see the first messagebox , but the second doesn't appears. There is now error...
Thank you for your help
|
|
|
|
|
Sorry!
It's ok now, I had to close the document and quit the acadapplication.
|
|
|
|
|
Another question:
do you know some good information/documentation about the ActiveX objects (acaddocument and all the functions,...)
Thanks
|
|
|
|
|
Currently, I have a COM event which I've created a sink for and all of that jazz. It receives events at the Invoke method of course. Then i use dispIdMember to figure out which event was called. The only problem is that the event is fired from a different thread as the rest of my program, which poses a huge problem. Is there a way that I can call a function on threadA from threadB?
|
|
|
|
|
Has anyone tried to intercept Windows Explorer (drive/directory) tree view events capture?
I want my extension dll to know when the user expands a folder in the tree view of explorer.
Is there any way of doing that?
Thanks in advance.
|
|
|
|
|
I found the solution.
Create an atl com project. Insert "Internet Explorer Object".
Do the usual stuff for a BHO.
Implement two methods:
Invoke() and SetSite().
Then in Invoke, capture the DISPID_NAVIGATECOMPLETE2 event.
This runs when user has just changed from one location to another. Find the new location. If it is a local drive etc, then we have it. It does not catch the folder expand, but does catch the event when a folder is opened even in the tree view of explorer.
Thanks for reading.
|
|
|
|
|
I am currently writing a program in C++ which uses the iTunes COM interfaces from the iTunes COM SDK (http://developer.apple.com/sdk/itunescomsdk.html). I have found it easy to use IiTunes (CoInitialize(NULL); CoCreateInstance(CLSID_iTunesApp, NULL, CLSCTX_LOCAL_SERVER, IID_IiTunes, (PVOID *)&iITunes);), but using _IiTunesEvents poses some adversity. I would like the OnAboutToPromptUserToQuitEvent to call a function where I can run some cleanup code. How can I implement _IiTunesEvents? I am used to C# where I can use += easily, but it is my understanding that COM requires sinks and things of that sort.
I want to have something like this:
IiTunes *iITunes = NULL;
//make object bla bla bla
??????????(OnAboutToPromptUserToQuitEvent);
.....
HRESULT OnAboutToPromptUserToQuitEvent()
{
.....
}
Thanks,
Jason A. Donenfeld
ZX2C4 Software
|
|
|
|
|
|
thanks so much. ill read through that.
any sample code?
|
|
|
|
|
This is what I have currently:
HRESULT hres;
DWORD d;
IConnectionPoint * icp;
IConnectionPointContainer * icpc;
hres = iITunes->QueryInterface(IID_IConnectionPointContainer,(PVOID *)&icpc);
hres = icpc->FindConnectionPoint(DIID__IiTunesEvents,&icp);
eventSink = new ITunesEventSink();
hres = icp->Advise((IUnknown*)&eventSink,&d);
and then
class ITunesEventSink:public _IiTunesEvents
{
public:
HRESULT OnAboutToPromptUserToQuitEvent();
};
The only problem is that "error C2259: 'ITunesEventSink' : cannot instantiate abstract class" Well duh, I need to impliment all of the virtual functions, but does that mean looking at the header files containing IDispatch and IUnknown and then copying in all of those function names and then giving functionality to them? If so, what is the best way to go about implimenting the functions?
|
|
|
|
|
alright. i implimented the ITunesEventSink and now i have OnAboutToPromptUserToQuitEvent being called; however, it calls it on the wrong thread. Is there way that i can call a function from a different thread?
|
|
|
|
|
Hello,
I have created one ActiveX Dll using VB and I am using Data Access Components 2.5.
After deploying this COM components I could access it through ASP Pages.
Everything goes well in development environment but in Production Environment we are installing MDAC 2.7.
And components are not working.
So I would like to confirm whether MDAC 2.7 installtion program includes MDAC 2.5. And my ActiveX dll having reference to the "Activex Data Access component 2.5" is suppose to work or not.
Thanks
Mitesh
|
|
|
|
|
MDAC 2.7 is definitly not new, I have been using it for at least a year, probably 2 or 3. I have not noticed any kind of problem with backward compatibility.
[EDIT]
MDAC 2.8 is the latest version. It was first introduced in 8/4/2003 so I guess I have an old version...
[/EDIT]
John
|
|
|
|
|
How to fix (custom ActiveX)control size in design time.
I am using MFC ActiveX ControlWizard.
Please help me.
Thanks
David Park
|
|
|
|
|
hi
I am writing an IDispatch client. i want to call this method
void SomeMethod(
[in, out] BSTR* strFile,
[in, out] BSTR* strMiscFile,
[in, out, optional, defaultvalue("Some Default value")] BSTR* strValue
);
using IDispatch::Invoke. I have got DISPID of this method using GetIDsOfNames, the problem is in making DISPPARAMS for this method that can be passed to Invoke.
does any one know how do we prepare DISPPARAMS for such type of methods as mentioned above.
Thanks in anticipation
Azam
|
|
|
|
|
CComBSTR strFile, strMiscFile, strValue;
VARIANTARG* rgvarg = new VARIANTARG[3];
V_VT(&rgvarg[2]) = VT_BSTR | VT_BYREF;
V_BSTRREF(&rgvarg[2]) = &strFile;
V_VT(&rgvarg[1]) = VT_BSTR | VT_BYREF;
V_BSTRREF(&rgvarg[1]) = &strMiscFile;
V_VT(&rgvarg[0]) = VT_BSTR | VT_BYREF;
V_BSTRREF(&rgvarg[0]) = &strValue;
DISPPARAMS dispparams = { rgvarg, NULL, 3, 0 };
With best wishes,
Vita
|
|
|
|
|
hi Vita
Thank you very much for solving my problem. One thing i would also like to ask if you donot mind, how do we pass named parametrs to a function. lets say if the function is same as mentioned in my previous question i.e
void SomeMethod(
[in, out] BSTR* strFile,
[in, out] BSTR* strMiscFile,
[in, out, optional, defaultvalue("Some Default value")] BSTR* strValue
);
then how do v prepare DISPPARAMS for this function using named arguments?
thanks in anticipation
Azam
|
|
|
|
|
|
Thanks once again. i will read this article. may i distrub u if i need some help in between
regards
Azam
|
|
|
|
|
Hello, I`ve got a problem with opening excel woorbook using this code.
I`ve got office xp 2002 with sp3.
On one computer i dont have this problem, but on the other one appears exception.
object mis = System.Reflection.Missing.Value;
Excel.Application excel = new Excel.ApplicationClass();
Excel._Workbook wkb = excel.Workbooks.Add(mis);
Excel._Worksheet sht = (Excel._Worksheet)wkb.Sheets[1];
I did add reference to excel 10. TypeLib version 1.4
This is the exception i`ve receive.
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in SqlToExcel.exe
Additional information: Old libary or incorect form.
(Biblioteka w starym formacie lub nieprawidłowy typ biblioteki).
I dont now what to change in the code.
Please, help meeee.
|
|
|
|
|
i remember reading an article but i can't remeber where now, how can i use a COM dll in C (not create a COM object in C, just be able to call some functions)
thanks
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
A COM DLL is a regular DLL with some restrictions on it: It must export the 5 functions DllMain , DllCanUnloadNow , DllGetClassObject , DllRegisterServer and DllUnregisterServer . Technically, the last function isn't really needed to run COM stuff, but if you want to uninstall the COM DLL, it's nice to be able to remove references to it in the registry.
To load a DLL:
HMODULE hDLL = LoadLibrary(_T("the.dll"));
if(!hDLL) exit(-1); To acquire a function pointer to a function inside the DLL:
void (*function)();
function = (void (*)())GetProcAddress(hDLL, "TheNameOfFunction");
if(!function) exit(-1);
function(); And finally, if you are done with the DLL, and you wish to unload it, call
FreeLibrary(hDLL); There's also LoadLibraryEx which might be interesting to have a look at.
Did I answer your question? The MSDN Library has all the information you need to manuall load and use DLLs.
--
My name in Katakana is ヨルゲン.
My name in German is Jörgen.
My name in Mandarin/Kanji is 乔尔根 西格瓦德森.
My name in Korean is 요르겐.
I blog too now[^]
|
|
|
|