|
An easy way is to select a CBitmap in a DC and draw the tiff. Or I know the CXImage class here at CP.
Greetings from Germany
|
|
|
|
|
Thank you for your time KarstenK.
Can you please state more in details, because i'm just starting in C++.
Best regards
|
|
|
|
|
Then you got to learn a lot and be patient "Rom wasnt build on a day".
Conversion of graphics is an interface problem: you need to transport the data from the source to a (temporary) format which the target format can understand.
I strongly advice you to download and step trough this really good project: http://www.codeproject.com/bitmap/cximage.asp[^]
If you really like graphic conversion you will agree that this one is outstanding:
http://www.codeproject.com/bitmap/extendedbitmap2.asp[^]
This will take you some hours, cups of coffee and some headaches if you are really engaged. But it is worth it.
Greetings from Germany
|
|
|
|
|
Writing a robust TIFF file loader is a big project.
If you can use GDI+, it can save alot of work.
There's also the ATL CImage class, which uses GDI+ for loading and saving image files.
With CImage, you could do it in a few lines of code:
#include <atlimage.h>
...
CImage image;
image.Load(_T("C:\\TIFFFile.tif"));
image.Save(_T("C:\\BMPFile.bmp"), Gdiplus::ImageFormatBMP); Note that BMP files have a limited set of supported image formats. See
the documentation for the BITMAPINFOHEADER struct for details.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all,
I have simple excel sheet in which i have 2 columns 1)employee name 2) employee id. All the columns having values is in sheet1. Now, my problem is i want to read my excel using code. i don't know how to do it. There are various articles using odbc but i don't want to use odbc. Can nybody tell me how to do it....
Thanks in advance.
|
|
|
|
|
make it via COM: create a excel object and read the data.
Greetings from Germany
|
|
|
|
|
can you guide me more on this...
|
|
|
|
|
Look for the search box (at top of the side) and enter "excel and com" or "excel and automation".
If it is to challenging for you, you should consider doing the stuff via a csv-File.
Greetings from Germany
|
|
|
|
|
Using this code you can get the values from xl sheet in the variant variable var.
There are step to use this code: -
1. write the import statements acording to the verision of office u have
for office 2000 they are: -
<br />
#import "Lib\mso9.dll" no_namespace rename("DocumentProperties", "DocumentPropertiesXL") <br />
<br />
#import "Lib\vbe6ext.olb" no_namespace<br />
<br />
#import "Lib\Excel9.olb" \<br />
rename( "DialogBox", "ExcelDialogBox" ) \<br />
rename( "RGB", "ExcelRGB" ) \<br />
rename( "CopyFile", "ExcelCopyFile" ) \<br />
rename( "ReplaceText", "ExcelReplaceText" ) \<br />
rename_namespace("EXL")<br />
Best place to add these statements is in stdafx.h
2.Declare these variables: -
<br />
EXL::_ApplicationPtr pEXLApp;<br />
WorkbooksPtr pEXLBooks;<br />
_WorkbookPtr pEXLBook;<br />
WorksheetsPtr pEXLSheets;<br />
_WorksheetPtr pEXLSheet;<br />
3.
<br />
::CoInitialize(NULL);<br />
try<br />
{<br />
if(NULL == pEXLApp)<br />
hResApp = pEXLApp.CreateInstance("Excel.Application");<br />
else<br />
hResApp = pEXLApp.GetActiveObject("Excel.Application");<br />
<br />
pEXLBooks = pEXLApp->GetWorkbooks();<br />
pEXLBook = pEXLBooks->Open(_bstr_t("Path of the xls file"));<br />
pEXLSheet = pEXLBook->GetActiveSheet();<br />
<br />
_variant_t var = pEXLSheet->GetRange("A1")->GetFormulaR1C1();<br />
<br />
pEXLApp->GetActiveWindow()->Close();<br />
}<br />
catch(_com_error &e)<br />
{<br />
string strError;<br />
_bstr_t bstrSource(e.Source());<br />
_bstr_t bstrDescription(e.Description());<br />
_bstr_t bstrError(e.Error());<br />
<br />
_bstr_t err_msg = "Error : " + bstrError + "\nDescription : " + bstrDescription + "\nSource : " + bstrSource;<br />
<br />
strError = _com_util::ConvertBSTRToString(err_msg);<br />
AfxMessageBox(strError.c_str());<br />
}
Regards,
Pankaj Sachdeva
"There is no future lies in any job"
"but"
"future lies in the person who holds the job"
|
|
|
|
|
I want to convert char[] string to UTF-8.
How should I use int MultiByteToWideChar() and WideCharToMultiByte() to do such convertion?
And if I should not use the two function to resolve such task,but how should I do?
Thanks.
GOOD LUCK
|
|
|
|
|
First use MultiByteToWideChar() to convert the char string from your local code page to wide char, then use WideCharToMultiByte() to convert the wide char string to UTF8. You may use CP_ACP for your local code page, and code page for utf-8 is 1200.
But I've never tried the conversion between wide char and utf-8, so I'm not sure whether it would succeed.
|
|
|
|
|
I also do not want to convert the string to UTF-8.But I use the "libipod"(a opensource code of iPod),it use utf-8 and utf-16!
|
|
|
|
|
it is good style to use the API-functions, because they do really a good job in checking different parameters and conditions.
But they are hungry for parameters.
Greetings from Germany
|
|
|
|
|
Hi all,
How can set the max length of a combo box to 50 charcters only
Thanks in Advance
Dana
|
|
|
|
|
|
From the MSDN Help:
CComboBox::LimitText
BOOL LimitText( int nMaxChars );
Return Value
Nonzero if successful. If called for a combo box with the style CBS_DROPDOWNLIST or for a combo box without an edit control, the return value is CB_ERR.
Parameters
nMaxChars
Specifies the length (in bytes) of the text that the user can enter. If this parameter is 0, the text length is set to 65,535 bytes.
Remarks
Limits the length in bytes of the text that the user can enter into the edit control of a combo box.
If the combo box does not have the style CBS_AUTOHSCROLL, setting the text limit to be larger than the size of the edit control will have no effect.
LimitText only limits the text the user can enter. It has no effect on any text already in the edit control when the message is sent, nor does it affect the length of the text copied to the edit control when a string in the list box is selected.
Hope it helps
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Thanks all,
I am new to VC++.Trying to set that property but not able to do so.
Dana
|
|
|
|
|
hi,
in advance thanks to look my problem,
i am executing pushsource program which is in platform sdk. i am getting some errors while linking. i dont know what to do i have already included strmbasd.lib in the project library and the path is also set.
can any one help me how to get rid of this errors.
the following errors i am getting.
Linking...
LINK : fatal error LNK1221: a subsystem can't be inferred and must be defined
PushSource - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
can any one help me how to solve it.
amiya kumar das
|
|
|
|
|
Hi all,
How can I perform the following actions programmatically ?
Perform the 'Open Containing Folder' action as when one right clicks on a searched fileShow the properties window of a fileCreate a shortcut to a fileMany Thanks in advance
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
|
Programm3r wrote: Why does this work:
explorer.exe /select, C:\MyDir\MySubDir\File.extension
And this does not
explorer.exe /select, C:\\MyDir\\MySubDir\\File.extension
because you're in the "Run..." windows, and not in your code, aren't you ?
the \ character is needed as the escapment character only in the source code, not in "running life"...
|
|
|
|
|
First tell me where r u using this ?? in your code and in adrees bar of window. It seems that u are writin it in adressbar of the window. otherwise The first one should not work and the second one should work.
WE are writing '\\' instead of '\' while assigning the string to distigunish it from escape sequence. I.e. '\n'represents next line.
|
|
|
|
|
GauranG033 wrote: First tell me where r u using this ?? in your code and in adrees bar of window. It seems that u are writin it in adressbar of the window. otherwise The first one should not work and the second one should work.
WE are writing '\\' instead of '\' while assigning the string to distigunish it from escape sequence. I.e. '\n'represents next line.
thanks for rephrasing my answer badly
moreover, you have a problem in you signature[^]. please close the html tags you open, because you're breaking the site's pages style.
|
|
|
|
|
I need to know which simple API function can i use to Check if some key exist in the registry and if it not exist in the registry then create it with some value that i need ( as default value ) ?
Thanks.
|
|
|
|
|
Use GetProfileString/GetProfileInt and WriteProfileString/WriteProfileInt functions for reading and writing string and integer values to retistry.
|
|
|
|