|
NiceNaiduUse DllRegisterServer
Exactly how is this of any help outside of the ActiveX file?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
1) u can use ShellExecute(NULL, NULL, "regsvr32.exe", <path to="" ocx="">, NULL, SW_HIDE);
2) you cant keep an ocx in the resourse and use it if you are doing static linking. if u are doing only dynamic lnking then, one thing you can do is to store the binaries from reourse into the harddisk and register from there.
cheers..milton kb
|
|
|
|
|
|
Aljechin wrote:
1. How do I use ShellExecute inside my MFC program to register an activex control, say MyControl.ocx located at D:\MyFolder?
While you can use ShellExecute() or CreateProcess() for this, you could also use LoadLibrary() and GetProcAddress() to call the exported DllRegisterServer() function.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Halo sir,
I went through your article which demonstrates the usage of UpdateResource() . Nice one. But from that I am unable to understand how do I do the same when I have imported it as a Binary resource into my MFC app. Its like I have an activeX DLL imported as a binary resource and it is a part of my executable now. I need to register the control to any machine on which the executable is run. I have understood that I could do it with ShellExecute() But I do not know how to use this resource!! Is copying this data to a file on the machine and registering it the only possible way? Can I not register it from within my program itself without copying this binary and creating a replica of the actual file?
Thanks for your help.
Aljechin.
|
|
|
|
|
Aljechin wrote: Is copying this data to a file on the machine and registering it the only possible way?
It's the only way that I am familar with.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
please any ont tell me how to type cast from CString to int
actually i receive the value from user and the value is int type but
i used its datatype CString now for futhure operation i want to typecast it
to int .
so plz tell me how i convert it.
Please mail me
-- modified at 2:04 Thursday 15th June, 2006
|
|
|
|
|
yogendra kaushik wrote: please any ont tell me how to typa cast from CString to int
i get the CString type value from user now i want to convert it in to int
for any use so plz tell me how i convert it.
here is one way
int i=atoi(str.GetBuffer());<br />
str.ReleaseBuffer();
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Calling GetBuffer and ReleaseBuffer is completely unnecessary. The following will work:
CString FName = "10";
int n = atoi(FName);
It works because CString has an operator LPCTSTR .
Steve
|
|
|
|
|
Stephen Hewitt wrote: Calling GetBuffer and ReleaseBuffer is completely unnecessary
Ohh...
GetBuffer and ReleaseBuffer is mostly used where you want to modify data of the CString instead of Format.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Use _ttoi() function
Amar
|
|
|
|
|
Try this way.
CString strInteger(_T("302"));<br />
int iValue = _ttoi(strInteger);
i value will be 302
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
|
You have recieved several answers to your question and they all show you how to convert a string to integer. Take note that this is not type casting, it is conversion from one form to another. This is important because you could type cast a string to an integer value but the value would not be the value entered in the string. It would take the individule byes and assume they are parts of the final number you are seeking.
char str = "AB"; // 'A' = 0x41, 'B' = 0x42
short n = (short*)(str); // n = 0x4241 = 16961
If you are wondering about the reversal of the numbers durring the type casting, then you need to go look up big endian and little endian on the Web.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Hi guys !
In windows service code
I have following code in function void CServiceModule::Run()
CDatabase DB;
try
{
if( !DB.IsOpen() )
DB.Open("PrinterDB");
}
catch( CDBException* e )
{
char Buffer[256]="";
AfxMessageBox(e->m_strError);
}
DB.Close();
here PrinterDB is the name of my DSN pointing to an MDB file.
Now when I run it as normal executable it works properly.
but When I run it as service (from MMC start service) connect to DB fails.
Please help me...
|
|
|
|
|
|
this is a security related issue.
what rdbms u r connecting to?
what kind of authentication you used in ur dsn?
cheers..milton kb
|
|
|
|
|
I am connecting to Microsoft MS acess database (mdb file.) . It says
try
{
// My code
}
catch( CDBException* e )
{
::OutputDebugString("CDatabase incorrect");
char Buffer[256]="";
AfxMessageBox(e->m_strError);
}
Error
"Data source name not found and no default driver specified"
|
|
|
|
|
how can we use flex and bison with visual c++
any tutorial and documentation....
-- modified at 1:41 Thursday 15th June, 2006
|
|
|
|
|
See Here[^] maybe it is some helpful to you
whitesky
|
|
|
|
|
actually i wanted to know how we can setup flex and bison with visual c++
because when i tried to compile lex.yy.c file with visual c++ it shows many errors not recognizing c operators 'exit','malloc','realloc','free'
|
|
|
|
|
It doesn't show how to use Bison with VC++, which is what the OP requested.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I am using word automation to get the text in a word document however, i face problems when the document is already open. Is there a way (coding) to check if that document is open and if open, close it?
|
|
|
|
|
Try below code.
Word::_ApplicationPtr wdPtr;<br />
Word::_Application::get_Application( &wdPtr); <br />
if ( NULL == wdPtr ) wdPtr.CreateInstance(__uuidof(Word::Application)); <br />
<br />
for (int i=0; i<wdPtr->Documents->Count; i++) {<br />
Word::_DocumentPtr dPtr = wdPtr->Documents->Item(i);<br />
if ( dPtr->Name == "whatever you are looking for" )<br />
dPtr->Close(); <br />
}
cheers ..milton kb
|
|
|
|
|
Hi guys!!
Have a trouble with the dialog bar!! I created a dialogbar in my application!! But I can't put a bitmap on button on that dialogbar!! Who can show me how!? I thanks very much
|
|
|
|