|
Hi, george_george
George_George wrote: What means "integral constant expression"?
They are alsoo known as compile time constants. Look at int const guidelines (boost)[^]
George_George wrote: Means for const static member variable, they are not l-value? Actually, I do not agree since for the const static member variable, it is addressable, so it should be a l-value.
This is not correct.
The meaning of l-value is : on the left side of an assignment.
Since its a const it can't be on the left side. Whether you got the address where that value
is stored doesn't matter. If you try to use it in any way on the left side of an expression
you would have an access violation. I'm guessing the value is placed in an read only segment
of memory.
codito ergo sum
|
|
|
|
|
Thanks BadKarma!
Great reply. I have re-read what you quoted in the Spec before, I am confused about what does the following statement mean?
(what makes me confused is in a class, which type of statement could be looked as definition, and which type of statement could be looked as declaration?)
"get away with the definition if you don't use them in their program"
regards,
George
|
|
|
|
|
Sir,
My COM class not getting registered.
Iam trying to register the COM DLL with .regsvr32.
It is not displaying either Dll Registered or Failed messge.
So, when i try to create instance of thet class, using CoCreateInstance
it returned Failure Code -2147221164 , that means Class not registered.
I want to know the reasons of CoCreateInstance failure.
Help me Plz.
Krishna.
|
|
|
|
|
Royaltvk wrote: It is not displaying either Dll Registered or Failed messge.
The above is unusual. Could you debug your DLLRegisterServer function?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Iam trying to debug this COMDll from my application .So that iam trying to crate instance of this COM DLL
just like this
CoInitialize(NULL);<br />
BSTR str;<br />
<br />
IDUOleServerImpl *pDXOLEServer;<br />
<br />
<br />
HRESULT hr = CoCreateInstance(CLSID_DUOleServerImpl, NULL, CLSCTX_ALL,<br />
IID_IDUOleServerImpl, (LPVOID *)&pDXOLEServer);<br />
if( !pDXOLEServer )<br />
{ <br />
szResponse ="Problem in Creating the DXOLE Engine Server";<br />
<br />
return ;<br />
}<br />
<br />
<br />
pDXOLEServer->ExecuteRequest(10001,bstrConnectionInfo,&str);<br />
But in my application is not be able to locate the server and throwing an error code -2147221164 i.e Class not registered.
But If i try to register the COM DLL for CmdLine Regsvr32, it is not throwing any success or failure notice.
Still iam mess up with this problem .
Please look at this.
|
|
|
|
|
U can create COM Object only if it is successfully Registered.
If u r debugging in this way u cannot find out the installation problem.
u need to debug the DLL while registering it.
Royaltvk wrote: But If i try to register the COM DLL for CmdLine Regsvr32, it is not throwing any success or failure notice.
may be this is because infinite loop, deadlock in the registration path
|
|
|
|
|
Please read CPallini's reply again. He said:
The above is unusual. Could you debug your DLLRegisterServer function?
If your DLL isn't registering properly, then of course CreateInstance won;t work!
Regedit is also your friend - you can see if the keys you need for registration are being created.
Iain.
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
if u don't know how to debug the DLLRegisterServer, following may be useful,
1) put a breakpoint in your DLLRegisterServer function
2) Set your COM DLL project as Startup project
3) IN your COM DLL project Settings set the values such that regsvr32.exe is started,
vsproperty->Debugging->Command = C:\WINDOWS\system32\regsvr32.exe
vsproperty->Debugging->Command Arguments = "$(TargetPath)" // path to COM DLL
4) start debugging
|
|
|
|
|
I am making a small dialog based application where i have an edit box. what needs to be done to display the value that is typed in the editbox. i want the messagebox to dispay the vlaue that is texted. i dont want to use the OK button. click and if the focus is lost the the value should display. any leads.
|
|
|
|
|
Chandrasekharanp wrote: if the focus is lost the the value should display.
Have you tried EN_KILLFOCUS ?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
yes i have tried EN_KILLFOCUS. i am not getting the right result. is there any other way?
|
|
|
|
|
EN_KILLFOCUS did help me in solving the problem. the logic which i gave was wrong.
Thanks
|
|
|
|
|
Why you didnt make your dialog instead use of messagebox?
|
|
|
|
|
Hello
I am working on vc++ project in which i want to create the sql connection with my MFC application, so that i can create a new sql database (.mdf file)
Is there any way to create a connection with sql server 2000 in VC++
and we also make a new sql database (.mdf) file .
kindly look into the matter
thanks
|
|
|
|
|
Hi,
its possible by using ado. In order to do let it work, you must preform some setup tasks.
1. Import the Library
place the following line in the stdafx.h file. the msado15.dll file should be located in the project directory.
#import "msado15.dll" no_namespace rename ("EOF", "adoEOF")
2. Initialize the ole lib
Ado works with oledb.
if(OleInitialize(NULL) != S_OK)
{
}
3. Connect to the database
Replace USER_ID, PASSWORD, SQLSERVERNAME, DATABASE_NAME with the correct values
CString strConnectionString;
strConnectionString.Format("uid=USER_ID;pwd=PASSWORD;driver={SQL Server};server=SQLSERVERNAME;database=DATABASE_NAME");
_ConnectionPtr ptrDbCon;
ptrDbCon.CreateInstance(__uuidof(Connection));
ptrDbCon->Open((_bstr_t)strConnectionString, "", "", -1);
<code></code>
You sould connect to the master database in order to create another database.
Just execute the queries to create an database as you need.
codito ergo sum
|
|
|
|
|
Thanks for your reply
as per your saying i connect the master database in order to create another database.but i don't know how i execute the query to create a new database
kindly give me the sample code or any syntax how to proceed further
thanks
|
|
|
|
|
Have you tried using the CREATE DATABASE command?
"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
|
|
|
|
|
As per ur suggestion i use create databse command and i able to create Database ,now i want to create Table in that database and i am using create table command bt it give an error message IDispatch error #3092 ,code: 0x80040e14 ,source :Microsoft OLEDB provider for sql server ,Description: There is already an object named 'myatble' in the database.
Bt there is no table present in the database with name myTable.
Pls help me regarding this.
|
|
|
|
|
aaaan wrote: Bt there is no table present in the database with name myTable.
But the error message you received mentioned 'myatble'.
"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
|
|
|
|
|
Did you see Databse section on the codeproject?
|
|
|
|
|
Hi friends ..i am very beginner to this field ..i dont know how to use API's .is there any articles or any url ...plz suggest me ..
Thanks n ADVANCE
raju.k
|
|
|
|
|
If you are a beginner and really are willing to learn, then you should read some good books. Windows programming has a steep learning curve. I'd suggest you the following books:
Programming Windows (fifth edition) by Charles Petzold[^]
If you'd like to do some MFC, then Programming Windows with MFC (second edition) by Jeff Prosise[^]
There are other libraries like ATL, WTL and frameworks (including non-microsoft ones, like VCF, WxWidgets, etc,.). But then you'll have to decide what you want to learn.
Trying to learn any of the above will require you to have good understanding of OOP and working knowledge in C++.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
|
Please refrain from providing such illegal links. I've reported that download as copyright infringement to rapidshare and your post as abusive.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
well there was nothing abusive in that. well if u felt so then i am sorry for that. i justed wanted to help him. that's all.
|
|
|
|