|
hi
i looking to load the image in an window how can i do it i tried with CpictureHolder .does any alternative way to do it.
note am not looking to load on background
Reply as soon as possible .
thanks sarfaraz
|
|
|
|
|
Perhaps CImage[^] is what you need.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Hello,
is there any c++ tutorial or (simple) open source sample how to write an OLE object that can be embedded into MS Office applications such as powerpoint?
Just like, for example, an Origin Graph or a corel draw image which are directly embedded into a powerpoint presentation.
When I search for OLE, I most often only find how to automate Office...
Alex
|
|
|
|
|
|
Thank you - this was easier than I expected.
Alex
|
|
|
|
|
I can insert my ActiveX object into Powerpoint and save/restore the data.
Now, I would like to automatically create a new object from a certain file type - ideally by drag and drop into Powerpoint. How can I achieve this?
Thank you in advance.
Alex
|
|
|
|
|
I never did that, however, I suppose you have to write a Shell Extension for that, check out the great article series[^] of Michael Dunn, here at CodeProject .
Veni, vidi, vici.
|
|
|
|
|
|
|
Please don't post the same question at multiple places.
The identical question in the Q&A section [^] already contains answers.
|
|
|
|
|
Alright, Fine, I got that. Now any answers?
|
|
|
|
|
Hi All,
I have a function in C++ dll like
FunctionCPP(int s)
{
}
I have a function in C# application(exe) like
int FunctionCSharp(int s)
{
return s;
}
what is the procedure to call FunctionCSharp from FunctionCPP?
Any help will be appriciated.
Thanks
G.Paulraj
|
|
|
|
|
Not sure how this would work with a C++ DLL loaded into a C# application, but read what MSDN[^] says here, maybe it can get you going.
Registering/Using somekind of inbetween COM interface sounds like a good idea.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
hi all
here is the my code[quick_sort),plz point the errors,remove the errors plz
i want run this programme in fedora also[what exactly the header file would be to find time consumed for sorting a given array[sorted/unsorted] ]
#inlcude<stdio.h>
#include<conio.h>
#include<time.h>
Const int MAX=1000;
Int partition(int a[],low,int high)
{
Int I,j,,temp,key;
Key=a[low];
I=low;
J=high+1;
While(i<=j&& key<=a[i]);
{
i++;
}
While(key>a[j]);
{
j--;
}
If(i<j)
{
temp=a[i],a[i]=a[j],a[j]=temp;
}
Else
{
Temp=a[low],a[low]=a[j],a[j]=a[low;
Return j;
}
}
Void quick_sort(int a[],int low,int high)
{
Int mid;
If(low<high)
{
mid=partition(a,low,high);
quick_sort(a,low,mid-1);
quick_sort(a,mid+1,high);
}
}
Void main()
{
Int a[MAX],n,I;
Clock_t end,start;
Start=clock();
Printf("enter the no of elements:");
Scanf("%d",&n);
Printf("\n enter the elements to sort\n");
for(i=0;i<=n:i++);
scanf("%d",&a[i]);
quick_sort(a,0,n-1);
end=clock();
printf("\n the sorted elemetns are:\n\n"(;
for(i=0;i<=n:i++);
printf("%d\t",a[i]);
printf("\n\n time consumed the array is: %5.2f sec",(end-start)/CLK_TCK);
getch();
}
|
|
|
|
|
One thing I noticed is that u are starting the clock before providing the input so if u take 5 minutes to enter the elements it will also be counted as time-took-to-sort. so better move the start & end as below:
<br />
<br />
Start=clock(); <- remove from here<br />
Printf("enter the no of elements:");<br />
Scanf("%d",&n);<br />
Printf("\n enter the elements to sort\n");<br />
for(i=0;i<=n:i++);<br />
scanf("%d",&a[i]);<br />
Start=clock(); -> put it here<br />
quick_sort(a,0,n-1);<br />
end=clock();
now the algorithm running time is not including the time for printing the messages and taking user input.
|
|
|
|
|
One more thing, i have not done the statistical analysis though but u are using 2 while loops one nested inside other why not simlify it with one while loop, Here is my implementation for the same, hopefully it will help:
<br />
void swap(int a[], int i, int j)<br />
{<br />
int temp = a[i];<br />
a[i] = a[j];<br />
a[j] = temp;<br />
}<br />
<br />
void qsort(int *arr, int first, int last)<br />
{ <br />
int pivot;<br />
int left = first;<br />
int right = last;<br />
<br />
assert(arr != 0);<br />
if(left >= right)<br />
{<br />
return;<br />
}<br />
pivot = left++;<br />
while(left <= right)<br />
{<br />
if(arr[left] < arr[pivot])<br />
{<br />
swap(arr, left, pivot);<br />
pivot = left;<br />
++left;<br />
}<br />
if(arr[right] > arr[pivot])<br />
{<br />
swap(arr, right, pivot);<br />
pivot = right;<br />
--right;<br />
}<br />
}<br />
<br />
qsort(arr, first, pivot - 1);<br />
qsort(arr, pivot + 1, last);<br />
}<br />
|
|
|
|
|
hi Rahul
thanks for the reply
but your programme[modified used 1 while] doesnt give the time consumed to sort the given array
right?
|
|
|
|
|
Well I will then suggest the use of Boost's time duration class. I think there is one because i used to sometime back. check out the documentation of boost.
|
|
|
|
|
Beside moving the start=clock() call to a more appropriate place as previously suggested, an old trick I learned in order to have reproducible test timings, always start your timing run on the beginning of a fresh clock tick.
clock_t start, end, tt;
tt = clock();
while ((start = clock()) == tt);
...begin timing test
end = clock();
Don't start the timing until you get a different answer from clock(), now you have a whole clock tick to work with.
|
|
|
|
|
here is my code-but i am getting segmentation fault???? any body help me???
programme aim is:to find a time consumed[taken] for sorting a given array
#include<stdio.h>
#include<time.h>
const int MAX=1000;
int partition(int a[],int low,int high)
{
int i,j,temp,key;
key=a[low];
i=low;
j=high+1;
while(i<=j&&key<=a[i])
{
i++;
}
while(key>a[j])
{
j--;
}
if(i<j)
{
temp=a[i],a[i]=a[j],a[j]=temp;
}
else
{
temp=a[low],a[low]=a[j],a[j]=a[low];
return j ;
}
}
void quick_sort(int a[],int low,int high)
{
int mid;
if(low<high)
{
mid=partition(a,low,high);
quick_sort(a,low,mid-1);
quick_sort(a,mid+1,high);
}
}
void main()
{
int a[MAX],n,i,start,end;
double CLK_TCK;
printf("enter the no of elements:");
scanf("%d",&n);
printf("\n enter the elements to sort\n");
for(i=0;i<=n;i++)
scanf("%d",&a[i]);
start=clock();
quick_sort(a,0,n-1);
end=clock();
printf("n the sorted elemetns are:\n\n");
for(i=0;i<=n;i++)
printf("%d\t",a[i]);
printf("\n\n time consumed the array is: %5.2f sec: ",(end-start)/(double)CLK_TCK);
}
|
|
|
|
|
You might get more help if you posted it to the Quick Answers instead of a reply just to me.
I can tell you that if you do post it in Quick Answers, the first thing people will ask for is "more information". Just saying "segmentatation fault" is not enough to go on. "Where" might help. ALso, nobody is just going to run and debug it for you, we don't have the data, the time, or the inclimation to do all the work for you. You'll have to show some results of your own debugging first.
|
|
|
|
|
I'm using SHFileOperation and it works well, but I really need to know when it's done because I'm setting the file permissions for users right after, and just want to make sure the files and folders are really there first.
I'm just looking for some suggestions on this if any may exist.
PS
I did write something for IFileOperation, but I was only able to get a single file copy to work, and haven't figured how to build the file array list for multiple folders and files.
|
|
|
|
|
Isn't it done when it returns?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
I thought that was the case, Wasn't really sure during some test runs, it looked like it was running in it's own thread.
I guess as long as the results are correct, that's all that matters.
|
|
|
|
|
It most likely does run in a separate thread but it also probably waits until this thread is done (just guessing this). However, if you experience that right after the operation some files can't be accessed it might be that the thread didn't release open handles yet to them (e.g. it is still in the process of terminating or somesuch) you could implement somekind of timeout mechanism, you try to access the file and keep trying periodically with some delays inbetween until you either succeed or some preset time period has passed, if you couldn't perform the operation before the time expired, error.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|