|
Hi
I tried debug it. I found that CBitmap *pBitmap = Gdiplus::FromFile(wfname) got loaded just once.
It is weird. When I just attach image, the image drawing is OK. But when I opened a project file, image drawing is very slow.
In the project file loading, when there is anything else is loaded, the image drawing is slow. If I comments out all other loading, only load image, the image drawing will be OK.
Thanks,
modified on Monday, June 8, 2009 11:39 AM
|
|
|
|
|
The disc operations are very costly. So please avoid loading the image during paint operations. Load the image during the dailog or window initialization or whenever requested by user( according to your context). Once the image is loaded in your memory there won't be much delay in operating.
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
i am not able to interpret what this code do...can somebody help me out.
This code is for accessing the data from the RecordSet Database
sprsRecordset->Fields->GetItem (vtFieldName)->GetValue ()
Can we write such a code in diffrent statements..
|
|
|
|
|
As a guess I would say it returns the value of the field for the record based on the current cursor position in the recordset. Probably as a type VARIANT. I would have to look at the documentation to verify that. Perhaps you could do that part, you know, looking at the documentation.
|
|
|
|
|
pandit84 wrote: sprsRecordset
This is a RecordsetPtr , you know.
pandit84 wrote: sprsRecordset->Fields
This gives the Fields collection of the recordset, as FieldsPtr .
pandit84 wrote: sprsRecordset->Fields->GetItem (vtFieldName)
Here you obtain the FieldPtr pointer corrensponding to the field <vtFieldName> of the current record.
pandit84 wrote: sprsRecordset->Fields->GetItem (vtFieldName)->GetValue ()
Eventually you get the value of the of the field object.
This example [^] probably helps.
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 need to be able to control the bass and treble on the computer sound card. I was looking at the setaudio command here http://msdn.microsoft.com/en-us/library/ms713256.aspx but could figure out how to use it. Is there a sample project that demostrates how to do this?
|
|
|
|
|
hiii
I'm trying to copy the used clusters of a hard disk partition(NTFS,windows os) to another partition.
I used the "FSCTL_GET_VOLUME_BITMAP" to get the cluster usage details.And I'm getting the used and free cluster counts correctly.And the cluster number I got is continuous.This makes problem for me. I wanna copy the used clusters to a different partition.
What type of cluster number I'm getting.? ; but the answer is correct.It makes confusion to me.
|
|
|
|
|
LPDISPATCH pDisp;
LPUNKNOWN pUnk;
CLSID clsid;
BeginWaitCursor();
::CLSIDFromProgID(L"Excel.Application", &clsid);
if(::GetActiveObject(clsid, NULL, &pUnk) == S_OK)
{
VERIFY(pUnk->QueryInterface(IID_IDispatch,(void**) &pDisp) == S_OK);
m_ExcelApp.AttachDispatch(pDisp);
pUnk->Release();
m_ExcelWorkbooks.AttachDispatch(m_ExcelApp.GetWorkbooks());
m_ExcelWorkbook.AttachDispatch(m_ExcelWorkbooks.GetItem(_variant_t(m_strTmepFileName)));
COleVariant covFalse((short)FALSE);
m_ExcelWorkbook.Close(covFalse,covFalse,covFalse);
m_ExcelApp.Quit();
m_ExcelWorkbook.ReleaseDispatch();
m_ExcelWorkbooks.ReleaseDispatch();
m_ExcelApp.ReleaseDispatch();
pDisp->Release();
}
EndWaitCursor();
I have used WebBrowser to display an Excel document,then I want to display another one which was saved as the same temperory file name,but the Excel process can be found in the task mannager,so I must kill it first.
m_ExcelWorkbooks.AttachDispatch(m_ExcelApp.GetWorkbooks())
m_ExcelApp.GetWorkbooks() method can not execute, I debuged it and found:0x00730069 unhandled exception: 0xC000001D: Illegal Instruction in excel _Application.GetWorkbooks method's InvokeHelper line. Can anybody tell me why? thx very much.
|
|
|
|
|
Hi,
Please clarify my doubts.
I have had the idea that passing pointers to a function chnages the actual value. So my follwing code should change the value of str
char *str="abc";
fun(str);
cout<<str;
.
.
fun(char *str)
{
str="gggg" ;
}
but="" its="" still="" showing="" abc...why?
now="" if="" i="" change="" the="" function="" definition="" to="" as="" follow
fun(char="" ;
}
it="" works="" fine....
but="" it="" doesnot="" allow="" me="" any="" character="" like...str[0]="str[0]+32;
Please" clarify="" my="" doubts
thanks="" in="" advance=""
<div="" class="ForumSig">-----------------------------
I am a beginner
|
|
|
|
|
himangshuS wrote: char *str="abc";
This creates a constant pointer.
So you cannot change its value.
You need to declare str as char str[X] instead of char *str;
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Sorry, wrong - str is not a constant pointer. The literal is points at is likely read-only, but that's by-the-by. The trouble is that the OP changes the pointer value that he passes to the function, NOT the value that the pointer refers to.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
What I believe is that declaring char* ptr = "abc" is exactly the same as const char* ptr = "abc".
And also when i tried what the OP says it didn't change the value even when giving "ggg".
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Sorry for being abrupt - I'm in a bit of a sh1t mood today .
«_Superman_» wrote: What I believe is that declaring char* ptr = "abc" is exactly the same as const char* ptr = "abc".
Mmmm - not quite. As far as the compiler's concerned, ptr is a char* - that's how you've declared it, the compiler trusts you. It will allow you to write to the contents of ptr. However, the underlying memory that ptr refers to (the string literal) is in read-only memory, so a combination of the compiler, linker and program loader (htat's what makes the string literal memory read-only, IIRC) has broken type-safety, by allowing you to assign a (const char*) pointer value to a (char *) pointer variable.
«_Superman_» wrote: And also when i tried what the OP says it didn't change the value even when giving "ggg".
As I said in my response to the OP, he is passing a pointer value to fun. You can change that pointer (as he does) in the function, but it's no different than (say) changing an integer parameter that you pass in. What you can do with a pointer is to change the thing that it points at:
fun(char* str)
{
str[0] = 'A';
}
However, as the original pointer references a string literal (which is in read-only memory, remember), this will accvio, as you're writing to read-only memory, and the processor's MMU ain't gonna let ya do that.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
You're right. I overlooked many things.
I guess I'm not my brightest best either. Viral fever has me down.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
«_Superman_» wrote: Viral fever
Not feeling piggy[^], I hope...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks for the consolation.
It hasn't been reported any where close to where I live.
Hopefully I'm not the first.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
A sincere thanks for all your replies
Thank you very much
-----------------------------
I am a beginner
|
|
|
|
|
himangshuS wrote: char *str="abc";
fun(str);
cout<<str;
.
.
fun(char *str)
{
str="gggg" ;
}
but="" its="" still="" showing="" abc...why?
now="" if="" i="" change="" the="" function="" definition="" to="" as="" follow
fun(char="" ;
}<="" blockquote="">
You are altering the pointer value that is passed into fun. Like all other value parameters, that updated value is not passed back out to update the thing whose value you passed in.
If fun was change to either of these, then you could alter the pointer. But
fun(char*& str)
{
str="ggg";
}
fun(char** str)
{
(*str)="ggg";
}
Hopefully the string literal "ggg" will stick around outside the scope of fun.
You could alter the string that str points at using this:
fun(char* str)
{
strcpy(str, "ggg");
}
But I really don't think that's safe either, as (in this case), str points at a string literal, which is likely to reside in read-only space.
I see you're using STL streams...why not go the next step and use STL strings as well. Then you can forget the division between pointer values and what they point at. See the code below - str is obviously a value, would you expect it to be updated by this function?
fun(std::string str)
{
str = "ggg";
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks for all your replies
Thank you very much
-----------------------------
I am a beginner
|
|
|
|
|
himangshuS wrote: fun(char *str)
...
Now if I change the function definition to as follow
fun(char *str)
They look the same.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
The function code looks different. He's copying 4 characters into string in one version and 3 in another.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
If you need to change the original string content, then you need something like:
char str[]= "abc";
void fun(char str[])
{
strcpy(str, "ggg");
}
Of course such a method is pretty unsafe (no boundary check).
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]
|
|
|
|
|
How to extract features of characters in hindi character pattern recognition
modified on Monday, June 8, 2009 7:32 AM
|
|
|
|
|
i don't think anybody can give you a book on the topic you asked for.
|
|
|
|
|
Your query is vague. Please explain a little more so that people here can understand better.
|
|
|
|