|
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> ![Jig | [Dance]](https://codeproject.freetls.fastly.net/script/Forums/Images/jig.gif)
|
|
|
|
|
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?
|
|
|
|
|
Can you be more specific do you get error
whitesky
|
|
|
|
|
|
BOOL o=CWnd::CreateEx(0, AfxRegisterWndClass(0), "CTest1", WS_POPUP, 0,0,0,0, NULL, 0);//return 1
whitesky
|
|
|
|
|
WS_POPUP and WS_CHILD flags do not go together. Only pass WS_POPUP with valid parent window handle.
GJ
|
|
|
|
|
|
Hi friends,
we try to use port forwarding concept in our application. freinds is their any software for port forwarding is available , so that we will use it in our application. or any sample code for port forwarding is available , so we will study that code and try to use in our application. If any links regarding port forwarding is ezists , provide us. frinds kindly give us reply.
regards
Girish
Software Developer
|
|
|
|
|
Port forwording is done by firewall automatically(u have to write rules).So what is ur purpose.
never say die
|
|
|
|
|
Hi,
I request u to kindly ans :
"How to place an edit box and dialog box on a window(SDI)( MFC based application)in VC++ dot Net-2003 version".
Thank you very much. 
|
|
|
|