|
Can you send an array of longs through a pipe? If it is possible, how would you do it?
Thanks in advance.
|
|
|
|
|
Typecast the array to whatever data type the function to send expects and give sizeof(array) as the size to be sent.
|
|
|
|
|
I never thought to do that, thanks so much, you're a lifesaver!
|
|
|
|
|
double a = 0.0000005;
char aa[50];
sprintf(aa,"s%lf",a);
printf("%s",aa);
Output:s0.000000
In the above code snippet, the variable aa can contain only 6 decimal precision. I would like to get an output "s0.0000005".
Could you please advice me on how to achieve this?
Thanks
|
|
|
|
|
See the MSDN documentation on printf format options[^]. It contains all the details of how you may customise this to your exact requirements.
|
|
|
|
|
|
I was hoping that my reply would encourage them to actually learn something beyond how to print to seven decimal places!
|
|
|
|
|
If they really want to, they will learn more after wondering what 9.7 means.
Otherwise they will never learn no matter what.
Just my opinion.
|
|
|
|
|
«_Superman_» wrote: If they really want to, they will learn more after wondering what 9.7 means.
I so want to believe that, but at my age I have more than 60 years of life experience to look back on ...
|
|
|
|
|
Ever the cockeyed optimist.
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
Sorry if this is a basic question, I'm new to C++. How would I go about creating a DC for an image from a file (.png) and then getting the HDC of said DC.
|
|
|
|
|
The MSDN documentation on Device Contexts[^] contains the functions you may use to paint onto any surface real or virtual.
See also the documentation on Windows GDI for useful tutorials, or this CodeProject Article[^] on bitmaps.
|
|
|
|
|
Hi,
I am currently trying to insert a picture control with more than 256 colors in a MFC dialog in a VC 6.0 project. However, when I paste the bitmap, the IDB_BITMAP resource looks correct, but when I try to reference it in a static picture control, the color depth is decreased dramatically.
How can I display a bitmap ressource with 24 or 32 bit in a MFC 6.0 dialog?
|
|
|
|
|
Try replacing the .BMP file that is created in the res sub folder with the high color bitmap file.
|
|
|
|
|
Hey,
I would like to write a c++ program that compares 2 images.In fact, I have many B&W images of a boat. I want to compare the contours, so that I could know how alike the images are. And, I want to be able to know the error percentage after comparing.
Do you have any advice or can you tell me any paper or book could help me.
Thanks in advance,
Franckesh
|
|
|
|
|
Go to Google, hit advanced search, limit the document types to .pdf, the websites to .edu, enter your search terms, and hit Search. You should get more papers than you can read in a year.
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
Maybe a strange tip:
Take a picture (1) and make a copy (2) of it. Now put the picture and the copy in a zip. Write down the filesize of the zip. Nex,t take another picture (3) and put it together with the original (1) into a second zip. Write down the filesize of the 2nd zip. Continue this till all pictures are put in zips. If you have 10 pictures you will have now 10 zips. Sort the zips to filesize. The zip containing your original (1) and its copy will have the smallest filesize. The next zip will contain that picture that resembles the original the most. And so on.
How this works: Zip searches for duplicate bitpatterns (this is how compression works). In the smallest zip it finds the most (coz their are 2 identical pics). The picture that resembles the first one the most is the one that has a little less duplicate bitpatterns (it compresses slightly worse). The filesize of the zip is an indicator of the resemblance.
Note: You will have to create zips for all the combinations...
The theory behind: Colmogorov complexities...
If you try this solution i would be pleased if you keep me informed of you results.
Rozis
|
|
|
|
|
Thank U, but I would like to know how to implement c++ codes to compare two b&W images pixel per pixel.
Or is there any better way to do implement the differences btw the images(if not pixel per pixel).
Thanks,
Franckesh
|
|
|
|
|
|
Hi,
In my minidump I am not getting proper call stack, but I do know one function which was called and its address comes as 0x0a415210. I want to locate the calls to this symbol, but don't know the range of memory were this could be.
Does anyone know how to locate the calls to this symbol in WinDBG?
Thanks
|
|
|
|
|
If it is the microsoft symbols that you want select File -> Symbol File Path from the Windbg menu and enter the string SRV*<your local symbol folder>*http://msdl.microsoft.com/download/symbols .
If the symbols belong to the project you created, put your PDB file in a folder and give the path to that folder as stated above. You can separate multiple statements using ; .
|
|
|
|
|
Hi ,
I have created a windows service project WindowsService1 and i have Win32 console project AppServer which is also in the same solution.
Now when i saw my service details as
Service1
LOcation: C:\testing\WindowServerice1\WindowsService1.exe
But i want to have like
Service1:
Location: C:\testing\Appserver\Appserver.exe
Your help much Appreciated.
Regds
Jain
|
|
|
|
|
Are you just wanting to change the output directory? Look into the project settings.
Correct me if I got you wrong.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Hi Rajesh,
Thanks for ur reply.
Intially , i have 2 project in my solution (1)Win32 Application- AppServer , (2) Setup project .
from this i created an MSI and installed my AppServer.exe to local & remote machine.
Now my requirement is , i have to register my application as windows services, so i have added one more project as WindowsService1
from VC++->Windowservice option,
i have builded all the 3 project and installed my Setup project , i tried to start my exe from services.msc, but here i am able to see
Servicename: Service1
Path: C:\testing\windowsService1\WindowsServcie1.exe
not C:\testing\AppServer\Appserver.exe
I need my Servicename as : Service1
& Path as C:\testing\AppServer\Appserver.exe
i mean my service has to point to my Win32 application exe.
Plz thru some light on this
Your help much appreciated.
Regds
Jain
|
|
|
|
|
I'm not sure if you need a third project, just for the sake of registering your executable as a windows service. In my opinion, the setup must have provision to register a program being installed as a service. Have you checked on that?
“Follow your bliss.” – Joseph Campbell
|
|
|
|