|
How send some bitmap with winsock?
|
|
|
|
|
You can send data over a socket. Bitmap is a data type.
Kuphryn
|
|
|
|
|
BITMAP bitmap;<br />
char *szBuff;<br />
int nBmpSize;<br />
<br />
::GetObject(HBITMAP, sizeof(BITMAP), &bitmap);<br />
<br />
nBmpSize = bitmap.bmWidth * bitmap.bmHeight;<br />
szBuff = new char[nBmpSize];
//You can copy any other data the will help you to create a bitmap(its size)
memcpy((void*)szBuff), bitmap.bmBits, nBmpSize);<br />
<br />
send(theSocket, lpBuff, sizeof(lpBuff),...);
//Use the received buffer to create a bitmap on the client/server side.
CBitmap bmp;<br />
bmp.create(...); <br />
bmp.SetBitmapBits(<font color=green></font>);
Email me if this works well, or for any other help!
--BlackSmith--
/*The roof is on fire, we don't need no water, let the MF burn*/. BHG.
|
|
|
|
|
I think it is easier to:
BITMAP bitmap;
char *szBuff;
int nBmpSize;
::GetObject(HBITMAP, sizeof(BITMAP), &bitmap);
nBmpSize = sizeof(BITMAP) + bitmap.bmWidth * bitmap.bmHeight;
szBuff = new char[nBmpSize];
//You can copy any other data the will help you to create a bitmap(its size)
memcpy((void*)szBuff), &bitmap, sizeof(bitmap)); // we will ignore 'bmBits' pointer
memcpy((void*)szBuff), bitmap.bmBits, nBmpSize);
send(...)
// now Create can use receive buffer that hold information on the bitmap
CBitmap bmp;
char* szBuff = (received buffer...)
BITMAP bitmap;
memcpy(&bitmap, szBuff, sizeof(bitmap));
bitmap.bmBits = szBuffer+sizeof(bitmap);
bmp.CreateBitmapIndirect(&bitmap);
ÿVOTD:5 "Keep your lives free from the love of money and be content with what you have, because God has said,
"Never will I leave you; never will I forsake you." " - Heb 13:5
|
|
|
|
|
Hello.
I have a MDI App. and I would like to create some views with the same width that the App. Frame.
This do not work because the View is bigger than the MDI Frame.
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
RECT rect;
SystemParametersInfo(SPI_GETWORKAREA,0,&rect,0);
cs.x = cs.y = 0;
cs.cx = rect.right;
return CMDIChildWnd::PreCreateWindow(cs);
}
Anybody knows how to make the MDI frame and view the same width that the App frame?.
Only the width, the heigth must be default.
Thanks in anticipation.
Tomás
|
|
|
|
|
Do not use SystemParametersInfo to get the size of the parent frame. Instead get a handle to the mainframe (AfxGetMainWnd) and get the client area rectangle.
--James
Drinking In The Sun
Forgot Password?
|
|
|
|
|
Thank you James. You are right, I have solved the problem.
Tomás.
|
|
|
|
|
I have implemented Ole Drag and Drop, and i want the item dragged to remain in the source list after it is dropped in the destination list?
what should be done?
Thanks
|
|
|
|
|
In the pdwEffect return value for your Drop Event handler, return DROPEFFECT_COPY and this will indicate to the source to make a copy of the data rather than moving the data. It is actually up to the source as to what it wants to do though.
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!
|
|
|
|
|
Hello there,
What's requrment for using MAPI ?
I mean is Outlook needed for using MAPI ?
Or MAPI32.DLL is enough and user doesn't need to install Outlook ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Use "Simple MAPI" instead. You do yourself ::LoadLibrary and ::GetProcAddress but at least you distribute a stand-alone DLL (mapi.dll). See MSDN for further details.
And I swallow a small raisin.
|
|
|
|
|
I am using the volo view express from autodesk now ,I can not get the GDI(CDC) from the IE control,I want to control the DWG file by program,
could anyone can help me!
Thanks advance!
Please pardon my weak English!
|
|
|
|
|
|
Hi.
I am very new to ASM. In fact, I have never written a source file for ASM or even compile an ASM program. Nonetheless, began reading a book on ASM programming and will start trying simple ASM programs soon.
The author mentions two ASM compiler, MASM and TASM. I download MASM32 from www.masm32.com. I cannot figure out how to compile an ASM source file using MASM. In the ASM book, the author mentions three commands. Two of which are for MASM.
-----
masm source; or masm source.asm
link source; or link source.asm
or
ml source.asm
-----
I downloaded MASM32 from www.masm32.com. However, I received file not found errors when I tried to compile an ASM source using the commands above. In other words, command prompt do not recognize masm, ml, or link.
I am using WinXP. Again, I am very new to ASM. I would like to know exactly what I need to do to be able to compile ASM source using MASM (unless TASM is better).
Thanks,
Kuphryn
|
|
|
|
|
MASM and MASM32 are two completely different assemblers.
You can D/L MASM from somewhere on the MS site. Try Googling for "MASM 6.14" if the MSDN search engine is as bad as usual.
++luck;
|
|
|
|
|
Oh. Okay. Thanks.
I will look for MASM.
Kuphryn
|
|
|
|
|
You've got MASM 7.0 along with VisualStudio 7 in the \bin directory, plus samples.
And I swallow a small raisin.
|
|
|
|
|
|
I am trying to implement Ole drag and drop,
and the register() with OLE dll is returning 0.
where could i have been wrong?
Thanks
|
|
|
|
|
You need to use OleInitialize on the thread that is calling the register function rather than CoInitialize. OLE must be initalized in order for you to use Drag and Drop.
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!
|
|
|
|
|
how to integrate the windows file manager in a visual c++ application ? i want the user to be able to navigate through the directories, select files, copy files (ctrl+c), paste files (ctrl+v), cut files (ctrl+x), rename files (F2), drag and drop (to copy/move/make shortcut, etc.), refresh automatically if the directory content is changed, explorer context menu on right mouse button, etc. (all the windows explorer functions)
...but i don't want to code anything myself. i only want to use a component, a library or something like that.
|
|
|
|
|
Just host a instance if IE and set the initial path that you want teh user to start at like C:\. You can even set it to "My Computer".
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!
|
|
|
|
|
|
Theres an article in ShellProgamming called SeaShell, which has some classes. There not exactly perfect and i went through it for about a month before i gave up but then again I needed a lot of functionality which it didn't have.
Using IE is simple but causes problems when you double click on a folder, it opens it up in another window instead of the same.
In the end for me i'm using a commercial activeX control called the 'Shell Active X Control Pack' Its pretty good you can get it from http://plasmatech.com.
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
indeed, seashell isn't perfect yet. how to host an instance of IE in my application ? maybe there's a way to prevent it from opening another window...
|
|
|
|