|
I cannot find the APIs on MSDN...
|
|
|
|
|
UuidCreate()
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Hello!
Mr. Dunn is correct. Alternatively, you could use the following code to get a standard CString that contains a new GUID:
GUID l_GUID;
::CoCreateGuid(&l_GUID);
OLECHAR szGUID[40];
::StringFromGUID2(l_GUID, szGUID, 39);
CString sGUID = szGUID;
Hope that helps!
Sincerely,
Alexander Wiseman
Est melior esse quam videri
It is better to be than to seem
|
|
|
|
|
|
I made a MFC extension DLL and it works fine. However, I have one exported class there that is built from another class. THus in the include it has included the header to that other class. However, I do not want to export that "other" class. So far I just exported it so that the program will work. Is there a way around it so that I don't have to export this "other" class?
THanks.
|
|
|
|
|
You only have to export a class, function or variable if you want to import it (use it) in a separate dll or executable. The only way that you will be exporting your class is if you declare it with the __declspec(export) compiler option, or if you have added a def file entry for that class.
Otherwise you can include as many class and function definitions in the main header and they will not be accessible. So if that parameter is defined for your class and it should continue to work and not be exported (as long as it resides in the same DLL that it is trying to be used from).
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
if use CSocket to connect to a remote server through internet, is an ip address in text format, i.e. sss33-23.jfgh.com.au the same as the one in number format, i.e. 2222.22.22.22?
thx
includeh10
|
|
|
|
|
No. Use the gethostbyname() function to convert a name address (abc.def.com) to its IP address (12.34.56.78).
Software Zen: delete this;
|
|
|
|
|
The only thing i can choose in the toolbox dialog under general is the pointer. Anyone know what could be wrong?
Thanks
|
|
|
|
|
open or create a project first. This helps...;P
How low can you go ? (MS rant)
|
|
|
|
|
hi,
I've three questions:
1-How to change boutton color?
2-How to use the horisental bar in a liste boxe, despite a activate when the text bypasse width of the list boxe it still remains deactivated?
3-how to use the progression bar? ( give me an example if it is psossible )
very urgent, I need reply befor tomorrow if you can.
|
|
|
|
|
|
LOL
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
His english sounds like from a french guy. Now it makes me sad.
How low can you go ? (MS rant)
|
|
|
|
|
sorry for my english,
I've three questions:
1-How to change button color?
2-How to use the horizontal bar in a list box, despite I activate it ,when the text bypass the width of the list box the bar is still deactivated?
3-how to use the progression bar? ( give me an example if it is psossible )
|
|
|
|
|
In a MDI application I have a CFormView (called CListForm) associated with a IDD_FORMVIEW dialog type which I use as a template for a docking bar (used to show some thumbnails). The IDD_FORMVIEW dialog simply contains a CListCtrl. In CMainFrm.cpp, CMainFrame::OnCreate() is used to create every toolbar and even my thumbnails docking bar.
// This bar is derived from CSizeBar 2.44 by Cristi Posea
CViewBar m_wndImageBar;
CRuntimeClass* m_pRuntimeClass;
m_pRuntimeClass = RUNTIME_CLASS (CListForm);
m_wndImageBar.Create(this,
m_pRuntimeClass,
(CCreateContext *)(lpCreateStruct->lpCreateParams),
"Images", WS_CHILD | WS_VISIBLE | CBRS_TOP,
AFX_IDW_CONTROLBAR_FIRST + 33));
The problem is how to access to CListForm from CMainFrm.cpp because now I have to populate the list with a list of bitmap pointers using a CListForm member function I called PopulateList(). I tried to create a pointer to CListForm object in this way:
CListForm* m_pListForm;
m_pListForm = (CListForm*)m_pRuntimeClass->CreateObject();
m_pListForm->PopulateList();
Object is correctly created and shown in my MDI application and its member variables correctly allocated but its hWnd handle points to NULL!!! WHY?!? Infact when PopulateList() calls this function:
CListCtrl* pListCtrl = (CListCtrl*) GetDlgItem(IDC_LIST_CTRL);
to refer to its child CList control, it crashes.
Which is the correct way to fully access to my CListForm from CMainFrame class?
Thx
|
|
|
|
|
Have you tried GetActiveView( )? This function is a member of CFrameWnd so you should have access to it in your CMainFrame class. Note that you'll have to typecast the return value to CListForm*
Hope this helps.
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Is there any small (really small) library or tip to convert a bmp file to jpg?
I mean, not a huge kind of classes or libraries at once. Just a single header file or some C that makes it without MFC ?
Regards.
|
|
|
|
|
LibJPEG is 90Kb when compiled, CxImage with CXIMAGE_SUPPORT_JPG only will be about 110K.
|
|
|
|
|
|
Ok, i have the jpeglib.lib library file, can you tell me how to convert the bmp to jpg now?
Regards.
|
|
|
|
|
I use jpeg library a lot, it's pretty easy. Check out the docs, Google up some sample code from the many packages that use it. Here is a small sample of compressing an image to a monochrome jpeg:
(A bit of code is always good. I stripped out a lot of particulars.. mostly error handling setup. Use this example as a source of good keyword combos in Google.)
bool JPEGCompressMono(FILE* Out,int Quality,unsigned char* pSrc,int Width,int Height)
{
struct jpeg_compress_struct cinfo;
struct jpeg_error_mgr err;
cinfo.err = jpeg_std_error(&err);
jpeg_create_compress(&cinfo);
jpeg_stdio_dest(&cinfo,Out);
cinfo.image_width=Width;
cinfo.image_height=Height;
cinfo.input_components=1;
cinfo.in_color_space=JCS_GRAYSCALE;
jpeg_set_defaults(&cinfo);
jpeg_set_quality(&cinfo,Quality,TRUE);
jpeg_start_compress(&cinfo,TRUE);
int Slop=(Width%4)?4-Width%4:0;
JSAMPROW row_pointer[1];
while (cinfo.next_scanline < cinfo.image_height)
{
row_pointer[0]=pSrc+(Height-1-cinfo.next_scanline)*(Width+Slop);
jpeg_write_scanlines(&cinfo,row_pointer,1);
}
jpeg_finish_compress(&cinfo);
jpeg_destroy_compress(&cinfo);
return true;
}
|
|
|
|
|
allright, but what if i need to convert a file for example it should be some function
that takes as argument 1 an output file and as for argv[2] the input file for example and does the dirty thing. isnt there something like this?
cause all i get in my program is a handle to the bitmap. nothing else, and i want to convert that bitmap to jpg. or even, i can save it to a bmp file and then for example i want to convert that bmp file to jpg.
all i see is that in the declaration of the RGBToJpegFile(...) there is a BYTE *data.
i have no idea what to do with it when i have a handle to bitmap / bmp filename.
|
|
|
|
|
If you have a handle to the bitmap, use GetObject with a DIBSECTION struct to find the bitmap bits (assuming handle is to a DIB section). If the handle is not to a DIB, use CreateDIBSection to create one, select it into a temporary DC and blit the bitmap into your DIB, then proceed. If the image is in a file, just read it into a space on the heap. (or map it into memory if truly large...)
|
|
|
|
|
If you are using MFC 7.0 (that is Visual Studio .Net) check
out the CImage class which should serve your purpose.
|
|
|
|