|
Yes, if you want to be able to access the main dialog. With a modal dialog, since it has its own message pump, you'll need to dismiss it before any other of the application can be started. See here for more.
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
I have this file
DET.TLB Its a type library
But, when I use it I get the error
Retrieving the COM class factory for component with CLSID {B65AD803-ABAF-11D0-BB8B-00A0C90F2744} failed due to the following error: 80040154.
SO basically this class is not registered or I don't have permissions to use it.
So, I thought maybe if I create a dll from the tlb file, I could then use it.
So does someone know how to do that?
I gave users full permissions and it still doesnt work, so does anyone know how to create a dll from that tlb?
Thanks,
nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Ista wrote: So, I thought maybe if I create a dll from the tlb file, I could then use it.
im not that much familiar with COM but I think just opposite is always happen that we are create TLB file from dll and also as off my knowledge we coould not register a TLB file
SaRath
"D on't blindly follow rules you read somewhere without verifying that it makes sense for your situation!"
|
|
|
|
|
The RegisterTypeLib(...) function can be used to register Type Library information (as well as a newer function that I cannot remember off the top of my head) - you can write a little app to use it.
However, it sounds like your problem is that the underlying COM object(s) DLL is not registered. I would start with finding that DLL and running RegSvr32 on it.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Ista wrote: DET.TLB Its a type library
But, when I use it I get the error
Use it? How?
A .tlb file contains a description of interfaces and other types defined in a .idl or .odl file that is compiled with the MIDL compiler.
The typelibrary (the .tlb file) could be included in the distributable binary, e.g. an ActiveX control, as a resource; or it could be distributed as stand alone file.
Either way it's tightly connected to the binary that it describes.
Ista wrote: I thought maybe if I create a dll from the tlb file, I could then use it
Think of the type library as a header file. When you've had that thought I assume you realize that you cannot compile a header file and build an executable application of it.
We "use" the type library when we add a library to the project, it could be a DLL, a COM server, an ActiveX control etc.
What happens here is that somewhere ::CoCreateInstance() is called and asked to create an object that has not been registered, at least not yet.
The cure for this is naturally to register the object/server.
--
Roger
It's supposed to be hard, otherwise anybody could do it!
Regarding CodeProject: "resistance is pointless; you will be assimilated"
|
|
|
|
|
Well what Im trying to, is Open a file ( classic asp ) and go to a specific line number. This is all done in InterDev.
Opening the file is easy "devenv.exe filename.asp"
But I need to go directly to a specific line number. So I thought I could link the library and Just use the COM to open the file and use the GoTo method to do my work.
So, in the VS2005, I create the reference. IThe environment creates the wrapper DTEClass(). ( file DTE.tlb in your IDE folder )
I instantiate it and but, I get this class not registered type error.
Do you have any ideas?
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
In what way are these questions related to the forum topics: VC++ and MFC?
I don't know anything about InterDev, which I suspect is crucial to be able to help you.
Regarding COM the simple fact remains: the server you're trying to use, one way or the other, has not been registered hence you cannot use it.
Whether this is something that gets installed together with InterDev or not I cannot tell you.
Have a look in the registry under the HKCR\CLSID and if you cannot find the key
{3C9CFE1E-389F-4118-9FAD-365385190329} the DTE server has not been registered.
This is the class id of the DTE for VC7 that I've found in the typelib Dte.olb.
You can also use OLE/COM Viewer to lookup interfaces/typelibs/servers that are registered.
--
Roger
It's supposed to be hard, otherwise anybody could do it!
Regarding CodeProject: "resistance is pointless; you will be assimilated"
|
|
|
|
|
Well. I just wanted to use the COM to open it up. I got it to work with versions 7.0, 7.1, 8.0.
I used the OLE viewer to find it, but it's no where to be found.
Maybe its not publicly creatable or something.
So I give up. I can open it, and just use SendInput to manipulate it.
Thanks, for helping tho. I've been doing .NET for so long, I forgot most of the COM rules.
Thanks,
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
I've had the same problem. I just wrote a wrapper in VB6 and used that dll instead.
If you really hate VB (like I do ) you can look into the
Interaction class which is able to call CreateObject and CallByName functions. I found this not so easy, but in my test case it worked fine except for the calls where a parameter was passed by value. (That's why in the end I resulted in VB6)
Hope this helps.
Coulda, woulda, shoulda doesn't matter if you don't.
<marquee>
|
|
|
|
|
Yeah. I absolutely hate VB! lol
SO I used The Interaction namespace to use create object. That works fine.
But, I just dont know the Prog ID for VisualInterdev.
I'm trying to automate some tasks, so I dont have to look at VB or classic asp more than I have to. It's like the plague to me.
If you know the prog ID, your my hero. I searched with every tool imagineable and no luck
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
It's somewhere in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Classes
You could do a look on the filename (without extension)
if OK you should have a Default string with a name and an AppID key with a GUID.
(eg. If your file is called yourname.tlb do a search on yourname under HKEY_LOCAL_MACHINE\SOFTWARE\Classes. Hopefully it will come up).
I didn't found how it linked with the tlb file though.
Good luck.
Coulda, woulda, shoulda doesn't matter if you don't.
<marquee>
-- modified at 14:59 Wednesday 31st May, 2006
|
|
|
|
|
yeah. I tried by class id.
Thanks for helping
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Hi.
In the debug window of VS, when I run the project, cames a string like this:
Ecception first-chance at 0x066d4931 in MyProg.exe: 0xC000001D: Illegal Instruction
(Together with the lines that tells that the DBG files are not founded)
But it is not linked to any line of my code!
Is there a way to find correct this warning?
Thanks.
Cheers,
Russell
|
|
|
|
|
|
mmm....
It is displayed 1 seconds before that the main window is displayed.
At that point of the execution I haven't used any pointer , I think.
Thanks anyway
Cheers,
Russell
|
|
|
|
|
You can use your debugger to narrow the problem. The call stack is also very usefull to find which of your function caused the crash.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
sigh: sigh:
It cames when
CvtkInteractor::Initialize()
Probally a bad dll of the VTK toolkit
Cheers,
Russell
|
|
|
|
|
I tried all what possible in VC++ , or windows to find device context
I want to start thread for engine simulation. but I have to pass the dc to my
function because it is generic class and not from mfc. what to do in this case.
or please let me know how to get view window from the generic class.
here is my code.
UINT CMy5CYLINDERView::ThreadFunc(LPVOID pParam)
{
CWnd *cwnd,*cwnd1;
cwnd1 = cwnd->GetWindow(1);
CDC* pDC = cwnd1->GetDC();
simulate* eng = (simulate*)pParam;
eng->nextpos(pDC); // program compiles on run gives access violation.
return 0;
}
void CMy5CYLINDERView::support()
{
FireCylinder();
for(int ii = 0;ii <= 3;ii++)
{
x[ii] = AfxBeginThread(ThreadFunc,(LPVOID)&engine[ii]);
}
}
|| ART OF LIVING ||
|
|
|
|
|
i think your problem is cwnd1 = cwnd->GetWindow(1); whats value cwnd(CWnd *cwnd)
whitesky
|
|
|
|
|
the reason why we are making a thread static because of to access the local resource of the class.
what u had done in the code is abosolutely wrong let me point out one of them
shivditya wrote: CWnd *cwnd,*cwnd1;
cwnd1 = cwnd->GetWindow(1);
In the above statement, cwnd* is not an initialized pointer. so u wont anything from there.
shivditya wrote: cwnd1 = cwnd->GetWindow(1);
This one something seems wrong. what u meant by GetWindow(1)?
it is better u pass this pointer the the function or make it accesseble trough some global static pointers.
i.e
static pszWindow; // declare as static member variable
static CMy5CYLINDERView::pszWindow = NULL; // initialize it globally
on Initial update, update this value with this pointer. then u can access it at the thread function
CMy5CYLINDERView::pszWindow->GetDC();
there is one more option.
define a structure that contains all information u need at thread
the definition may goes like this
typedef struct
{
CMy5CYLINDERView* pView;
Engine* pData;
}MyThreadParam;
now u "allocate memroy" (dont pass local variable) for the type of structure and fill with required informatio and pass to the thread param
at thread function type cast and use it.
SaRath
"D on't blindly follow rules you read somewhere without verifying that it makes sense for your situation!"
|
|
|
|
|
static CMy5CYLINDERView::pszWindow = NULL; // initialize it globally
on Initial update, update this value with this pointer. then u can access it at the thread function
CMy5CYLINDERView::pszWindow->GetDC();
there is one more option.
define a structure that contains all information u need at thread
the definition may goes like this
This highlighted line gives error as pszwindow is not object of CDC
its really problem beacause this thread function is static and it restricts a lot
|| ART OF LIVING ||
|
|
|
|
|
shivditya wrote: CWnd *cwnd,*cwnd1;
cwnd1 = cwnd->GetWindow(1);
CDC* pDC = cwnd1->GetDC();
You are using cwnd but it was never initialized....
The DC of which window do you want to get?
Is eng is part of that window?
If so , try using this code:
UINT CMy5CYLINDERView::ThreadFunc(LPVOID pParam)
{
YourWindow *wnd = (YourWindow *)pParam;
CDC* pDC = wnd->GetDC();
wnd->eng->nextpos(pDC);
return 0;
}
With best regards,
Eli
|
|
|
|
|
YourWindow *wnd = (YourWindow *)pParam;// You should pass the handle of the window as pParam
Here what means YourWindow
Beacuse I am able to get the active window I am not able to get device context.
will you please explain me what you mean by your window.
I tried long journey of HWND hwnd = :: GetActiveWindow()
then CDC tempdc = (CDC*)( ::GetWindowDC(hwnd));
but it also proved hopeless.
|| ART OF LIVING ||
|
|
|
|
|
Hi
I am popping a default mail client with an attachment for sending the mail in my application.I used a dll which inturn used Mapi.I could successfully popup the default mail client when Eudora,Outlook express are set as default mail clients but when i set MSOutLook 2003 as default i could not.
Any Suggestions or links would be useful for me.
Thanx
|
|
|
|
|
A CWnd based class creates a popup window:
BOOL b=CreateEx(0,0,0,WS_POPUP|CHILD,rc,pMum,100);
in XP, the call failed, by in 98 and other OS, the call is OK.
how to solve the problem for XP?
|
|
|
|