|
In the .IDL (or ODL file) change the declaration so it looks something like this:
HRESULT Command([out, retval] BSTR *pOut);
Now the function should look like this:
STDMETHODIMP CMyClass::Command(BSTR *pOut)
{
if ( pOut == NULL )
{
return E_POINTER;
}
*pOut = SysAllocString(L"Your string here!");
return S_OK;
}
If you're not familiar with BSTR s you should read up on them.
Steve
|
|
|
|
|
There are some data to be analyzed, and draw the result as a figure. I want to draw the result in memory firstly and then save the memory BMP to a file directly, not to show it on screen. How can I do that.
Note: I want to achieve all in dialog, not Doc/View framework.
By the way, the resulted BMP may large than the sreen.
Thanks a lot!
-- modified at 23:57 Sunday 12th March, 2006
|
|
|
|
|
if u use memory DC, 2 suggestions:
1. bad one.
use GetPixel() to get color of a pixel - scan whole image - so u can have bitmap bits then save ur bitmap.
2. good one
I remember we can Create Bits section for memory DC (not sure), so bitmap bits can be read directly from memory DC.
anyway, u have to know file format of bitmap.
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
|
But I don't want to show the BMP on screen!
|
|
|
|
|
Hi FleetAdmiral,
(I think you can change CreateCompatibleDC to createDC)
HDC hdc= CreateCompatibleDC(GetDC()->m_hDC);
HBITMAP hBitmap=CreateCompatibleBitmap(GetDC()->m_hDC,Width,Height);
SelectObject(hdc,hBitmap);
//Here you can from handle hdc
TextOut(hdc,150,150,"Hello",lstrlen("Hello"));
hBitmap=(HBITMAP)SelectObject(hdc,hBitmap);
CImage Image;
Image.Attach(hBitmap);
Image.Save("c:\\test.bmp");
Image.Detach();
DeleteDC(hdc);
DeleteObject(hBitmap);
|
|
|
|
|
if u dont want to show it in screen , u can create a memory dc and draw the bitmap to that dc.Then while saving to file, pass the bitmap object of this memory dc.
nave
-- modified at 0:21 Monday 13th March, 2006
|
|
|
|
|
an int array, assume length is 10:
int ary[10];
now i need to display all of them - 5 of them every time as arrangement - no repeat, no missing.
i.e.
ary[0],ary[3],ary[6],ary[7],ary[8]
is one of them to be displayed.
any idea?
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
What u mean by this???
>>>>> 5 of them every time as arrangement - no repeat, no missing.
|
|
|
|
|
Hi,
I am new to VC++, I just need to know how to print something in the child view that i have stored in the document class?? cn i use the archive object??
please help me wid this one
rMb
|
|
|
|
|
if u want to print them by printer, use SetMapMode(MM_LOENGLISH) to dc.
1n this mode, 100 pxels equal to 1 inch, Y direction is up.
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
I'm tring to write a program that can control an opticam m1 webcam. I've installed it's driver, but I can't find an API I can use. does anyone know where I can find such an API?
Is it possable that the componey that made these device doesn't want to give out it's api?
|
|
|
|
|
Hello Chaos,
Have you try for this. Use all Macros starting with cap .
Divyang Mithaiwala
System Engineer & Software Developer
|
|
|
|
|
the opticam has a built in motor; I'm looking for an api to control that motor. The macros on that site (as far as I can tell) only deal with the normal webcam functions on the cam (unless I'm over looking something).
Thanks anyway.
|
|
|
|
|
Hi everyone
I downloaded visual C++ express edition from the internet, somehow i dont have the build operation, is there any other way to compile the program or should I download something else.....any link or info would be helpful
Thanks!
ashira
|
|
|
|
|
what do you mean "dont have build operation" - build is failing or you don't know how to build.
-Saurabh
|
|
|
|
|
well, there is no build tab. There are all the other tabs including debug but no build tab...so how do I compile the program in the express edition
|
|
|
|
|
I think you are opening a source file(s) without a project. In visual studio you must create a project and add files to it to be able to compile. To create project use File->New->Project.
-Saurabh
|
|
|
|
|
first set the project and workspace settings properly. then try doing it.
Vasanth
|
|
|
|
|
I would like to write values to a file, and now the member of Class A is
const valueType *getValues(int start) const
{ evaluate(); return (const valueType *)(values + start); }
I tried to use CString/_gcvt to convert it to string/charm=, but failed.
Anyone can help me how to realize it?
thanks
|
|
|
|
|
Hi,
I think sprintf will do the trick for your Question. I didnt try it.
#include <stdio.h>
#include <string.h>
char *DoubletoStr(char *s, double dd);
int main(void)
{
double values2[] = {34709.22, 3746.55, 23456};
char value[32];
int i;
DoubletoStr(value,values2[i]));
return 0;
}
char *DoubletoStr(char *s, double dd)
{
char *endp;
sprintf(s,"%f",dd);
for(endp = s+strlen(s); endp!=s;endp--)
{
if(*(endp-1) != '0'&& *(endp-1) != '.')
{
*endp = '\0';
break;
}
}
return s;
}
Good Luck.
Helping others satisfies you...
|
|
|
|
|
not sure I understood the problem. if you have an array and you want to simply DUMP it to a file, you don't need to do any convertions. the data (in the memory) is already stored in bytes (and bytes are the same, memory wise, as chars). just use the sizeof(float) * the number of elements, and cast that array to a char* variable.
If you want to convert the data to a text data, you'll need to format it. either use CString, of sprintf
Hope this helps.
|
|
|
|
|
I am new to DLL. I am developing a directshow filter (DLL project), and I need to use some functions from other DLL, can I develop the DLL based on other DLL? Thanks
|
|
|
|
|
|
I am using the DSOFramer control to try in insert an Excel Chart into an MFC Dialog. I can get a chart with sample data to appear, but am not sure how to get my data into it or customize the graph. I have read the microsoft article explaining it, but need a little more help! Any info would be greatly appreciated! Thanks!
Jen
|
|
|
|