|
Thank You Cedric Moonen, I thought there may be some documents which talks about migration. Any I will just complie and check the same.
Thanks,
Nandu
|
|
|
|
|
Hi Experts,
How can I regitser a dll file through programming?
|
|
|
|
|
dynamically link to the DLLRegisterServer() function exported by the COM Dll and call it.
|
|
|
|
|
Can I use CreateProcess()?
|
|
|
|
|
pther wrote: CreateProcess()?
No, DLL is not a executable!, but you could pass regsvr32.exe \s COMDLL NAME in createprocess, '\s' switch will register it silently!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
CreateProcess(NULL,_T("D:\\MYDLL\\regsvr32 mydll.dll"), NULL,NULL,FALSE,0,NULL,
NULL,&StartupInfo,&ProcessInfo);
This is giving exception.
|
|
|
|
|
pther wrote: CreateProcess(NULL,_T("D:\\MYDLL\\regsvr32 mydll.dll"), NULL,NULL,FALSE,0,NULL,
NULL,&StartupInfo,&ProcessInfo);
This is giving exception.
what exception?
what about,
"regsvr32.exe \\s \"D:\\MYDLL\\mydll.dll\""
|
|
|
|
|
I used like this
CreateProcess(NULL,_T("regsvr32.exe \"D:\\MY DLL\\mydll.dll\""), NULL,NULL,FALSE,0,NULL,
NULL,&StartupInfo,&ProcessInfo);
using GetLastError(), it is returning 0;
|
|
|
|
|
"The Unicode version of this function, CreateProcessW, will fail if this parameter is a const string." from msdn;
try this,
TCHAR szCmd[] = _T("regsvr32.exe \"D:\\MY DLL\\mydll.dll\"");
CreateProcess(NULL, szCmd, NULL,NULL,FALSE,0,NULL,
NULL,&StartupInfo,&ProcessInfo);
|
|
|
|
|
in continuation with rajkumar, this tip could help
http://www.visualcpp.org/?p=51[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
Hello everyone,
In MSDN length_error sample,
http://msdn2.microsoft.com/en-us/library/2af6btx2.aspx
it uses internal macro _SIZT, other than size_t. I have found in file xmemory, _SIZT is defined to size_t.
So, my questions are
1. why not use size_t directly, why use an internal name (begins with _)?
2. Do we have to use _SIZT when we define a customized allocator?
thanks in advance,
George
|
|
|
|
|
From what I can read and understand, _SIZT and size_t are interchangeable.
so.
1. why not.
2. no.
anyway, in my experience, which is not that extensive with STL (other than using containers and algorithms), I never had the need
to define or even start thinking about defining an allocator for existing containers.
|
|
|
|
|
Thanks Maximilien!
Question answered.
regards,
George
|
|
|
|
|
First I apologize. I like the MFC board, so I put this unrelated thread here.
As you know, I gathered good articles in CP saved as html files in my computer.
I want to build all these articles to a chm file with favourate collect (especially needed) ,
search functions.
How could I achieve this goal? Please don't laugh at me.
I'll appriciate for your help. Many thx.
modified on Thursday, February 28, 2008 3:04 AM
|
|
|
|
|
|
fantasy1215 wrote: As you know, I gathered good articles in CP saved as html files in my computer.
No, some of us do not know.
fantasy1215 wrote: Please don't laugh at me.
Why? Are you doing something that you think warrants a laugh?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
We have a bunch of code that works for IE6, but doesn't for IE7. Two examples:
try
{
hres = pDispatch->GetIDsOfNames(IID_NULL
, &memberName
, 1
, LOCALE_SYSTEM_DEFAULT
, &nameDispId
);
}
catch(...)
{
// Stupid IE7 will blow up instead of returning DISP_E_UNKNOWNNAME
hres = DISP_E_UNKNOWNNAME;
}
When we pass in a method it can't find ( typically because we have
getNodeNames when we want the get accessor for the nodeNames property
), IE6 returns the right code, IE7 blows up. This above solves our
problem.
// See if we can get the ITypeInfo interface off this object
CComPtr<ITypeInfo> pTypeInfo;
pDispatch->GetTypeInfo(0, 0, &pTypeInfo);
This just blows up in IE7, no matter what.
Have things drastically changed in IE7 ? Is this documented somewhere
? I've been googling...
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Can you show the definitions of memberName & nameDispId ?
Steve
|
|
|
|
|
memberName is a string, and if it's a string that is not a member in the class, it blows up, if the string IS a member, it works fine. I don't have the code at home, but nameDispId is what it needs to be, and the code works perfectly if the string does refer to a member. Our old code would pass in getNodeName, for example, expecting this code to return the E_FAIL value that indicates a value does not exist ( as IE6 does ), and then our code finds that, strips the prefix and looks for a get or set on nodeName ( for example ). A try/catch causes this lower down code to work perfectly too. It's the second block that just plain blows up every time.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I'm not sure why memberName being a member or not would cause problems. Have you checked that the this pointer is valid? The try /catch is a little sloppy: In standard C++ catch can only catch exceptions explicitly throw with the throw statement and not hardware exceptions such as access violations. MSVC6’s behaviour is non-standard in this respect and later versions allow standard behaviour or the old non-standard behaviour via the /EH[^] compiler switch. Also, according to the COM rules, COM methods can not throw exceptions, so if one does the correct thing to do is crash.
Steve
|
|
|
|
|
I'm working in a VC++ Project. In this project, the key F12 is assigned as a Virtual key for doing something. When I run the exe I got a strange exception which states "Unhandled exception. User break point". I'm saying it's strange because When I debug the project, the exception is thrown. But if I press CTRL+F5 to debug the project the exception is not thrown. What to do overcome this exception? Can anyone help?
|
|
|
|
|
Use some message boxes during runtime (not debugging) to approach what line throws the exception. And then maybe you will know the solution, or you can post that code snippet here!
For example:
CString sTxt;
sTxt.Format("%s (%d)", __FILE__, __LINE__);
AfxMessageBox(sTxt);
Maxwell Chen
|
|
|
|
|
If I break the exception,the control goes to this function.
BOOL CPerspectiveApp::OnIdle(LONG lCount)
{
CWinApp::OnIdle(lCount);
if(CWnd::GetFocus() == NULL)
return TRUE;
if(m_pkRenderView)
m_pkRenderView->OnIdle();
theJoystick.Read();
return TRUE;
}
CPerspectiveApp is a class derived from CWinApp. But the corresponding to thekey F12 is,
if(nChar == VK_F12)
{
m_pDoc->ResetTime();
}
Can u Pls help?
|
|
|
|
|
How do you say, the exception is due the F12 key event handling, In the your post you didn't say exception occur when F12 key is pressed.
Exactly where the exception occurs, you said the call stack is on CPerspectiveApp::OnIdle(), but which statement.
from the code, I think the exception occured on
m_pkRenderView->OnIdle();
May be you are not initialising m_pkRenderView to NULL, and while in debug OnIdle may be called before creating the object m_pkRenderView and crashed, while in release, OnIdle may be called after creating the Object m_pkRenderView. where you are creating the object m_pkRenderView.
Which statement caused the exception.
|
|
|
|
|
|