|
Sumanta Banerjee wrote: Can not create Inprocess Reco Engine
In the other news, KFC recommends pepsi.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
BTW: welcome again in the CP's Memorable Quotes List [^].
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
[My articles]
|
|
|
|
|
I'm not sure if I can keep this pace.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Well, you're young and talented...
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
[My articles]
|
|
|
|
|
Will the destructor called in case of excetion occures, Note DataMember is a class data member whoese instance is created
out of try bock, Pls suggest best way to handle it.
~Cls::Cls()
{
delete DataMember;
}
Cls::Function()
{
DataMember = new DataMember;
try
{
}
Catch()
{
}
}
|
|
|
|
|
If you're creating the object using the new operator, the destructor will be called only when you do a delete.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Well true, but in this case I am talking about the destrutor of ~Cls::Cls, when exception occure in Cls::Function().
What would be best way to delete DataMember; incase exception occur
|
|
|
|
|
~Cls::Cls will not be called unless you are calling Cls::Function from Cls::Cls .
You must delete DataMember in the catch block.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Would Finally will be more approriate ?
but DataMember is not in try block
|
|
|
|
|
It is recommended you use try/catch rather than __try/__finally .
Since DataMember is declared outside the try block, it is accessible in the catch block also.
If it were declared inside the try block, then you wouldn't be able to delete it in the catch block.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
|
Hi,
I have created Static control programmatically.I need to display image in
static control of Dialog.I have written following code
HINSTANCE hInstTemp = AfxGetApp()->m_hInstance;
HBITMAP hbmp = NULL;
if(hInstTemp != NULL)
hbmp = (HBITMAP)LoadImage(hInstTemp,_T("C:\\vicky.bmp"), IMAGE_BITMAP, 50, 50,LR_LOADFROMFILE);
if(hbmp != NULL)
myStatic->SetBitmap(hbmp);
shall I need to call DrawItem or override DrawItem??
|
|
|
|
|
Have you set the SS_BITMAP for that static control?
- ns ami -
|
|
|
|
|
yes I have set SS_BITMAP|SS_CENTER.
If I did not set SS_CENTER Image is coming properly.
Thanks for your reply.
|
|
|
|
|
hemlat wrote: yes I have set SS_BITMAP|SS_CENTER.
I doubt you mistook SS_CENTER instead of SS_CENTERIMAGE. Please check.
- ns ami -
|
|
|
|
|
No you can insert SS_BITMAP with ModifyStyle to your control and for bmp files you can use of this function but for jpg files you need to use of CImage class.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Thanks for your reply.JPG files also coming Properly.
|
|
|
|
|
Assume prfimg Bitmap is proper.
EncoderParameters pEncoderParameters;
pEncoderParameters.Count = 1;
pEncoderParameters.Parameter[0].Guid = EncoderCompression;
pEncoderParameters.Parameter[0].Type = EncoderParameterValueTypeLong;
pEncoderParameters.Parameter[0].NumberOfValues = 1;
ULONG compression = EncoderValueCompressionRle;
pEncoderParameters.Parameter[0].Value = &compression;
GetEncoderClsid(L"image/tiff", &encoderClsid);
st = prfimg->Save(L"i:\\m\\img.tif", &encoderClsid, &pEncoderParameters);
getting value of st as InvalidParameter and the image is not saved properly on disk(saved image size on disk is 1KB)
Please tell if something more needs to be done to save tif image with Rle compression.
Other compression options gives the same InvalidParameter result.
Thanks and Regards.
|
|
|
|
|
I have added the key in HKLM on Xp64bit OS.
HKEY_LOCAL_MACHINESOFTWARE\\TEST\\App\\MyKey === "CodeProject"
Now, I have tried with below mentioned way,
bool Result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\TEST\\App"), 0, KEY_READ, &hKey) == ERROR_SUCCESS;
if (Result)
{
Result = RegQueryValueEx(hKey, TEXT("MyKey"), NULL, &dwType, (LPBYTE)&szTemp, &dwSize) == ERROR_SUCCESS;
switch(dwType)
{
case REG_BINARY:
AfxMessageBox ("\ntype: REG_BINARY");
break;
case REG_NONE:
AfxMessageBox ("\ntype: REG_NONE");
break;
}
}
Messagebox displays"type: REG_NONE". That means, "No defined value type".
So, how to get my key (MyKey) value "CodeProject"?
Sethuraman.K
|
|
|
|
|
Sethuraman.K wrote: if (Result)
This must be if (ERROR_SUCCESS == Result)
and Result must be declared as a LONG and not bool .
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
That works fine only. I am talking about "dwType"
Sethuraman.K
|
|
|
|
|
The value of ERROR_SUCCESS is 0.
So, in you code if it is entering if(Result) , it means you are not getting ERROR_SUCCESS , which means an error in the open itself.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I got the solution. If our application is 32bit then registry entry (only for HKEY_LOCAL_MACHINE) in 64 bit OS sould be in
HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node
in my case entry should be in
HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Test\\App
Sethuraman.K
|
|
|
|
|
Hi All
I am useing timer in main dialog class.Calling Timer on On OnInitDialog function.But my dilaog become not responding.Plz help me.
|
|
|
|
|
It is most likely because you did something wrong.
...
but seriously, give some code, more details, otherwise noone will be able to help you.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|