|
I need pass strings asyncronous. Cuold you give me more details abuot it?
Thanks.
|
|
|
|
|
So when the string gets updated in your VC app you want VB to be notifed and pass the new string?
If this is what you want, you need to define a COM interface in your VC app and make uses of the Implements functionality of VB. The VC app then calls the VB implementation of the interface when it needs to notify VB of a change.
How much COM have you done before? The following articles will probably explain things better than I can
http://msdn.microsoft.com/library/default.asp?URL=/library/welcome/dsmsdn/drgui102599.htm
http://www.codeproject.com/com/connectionpoints1.asp
http://www.codeproject.com/com/connectionpoints2.asp
Hope this helps
Michael
|
|
|
|
|
I didn't understand ...
It means, for example if i create the ActiveX by MFC ActiveX, may be my control don't run in other programming language ?!!! (For example in VB ?)
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hi,
You can use BSTR I think I saw an article on this technique in MSDN.
Good luck,
Dror
|
|
|
|
|
I want to pass data from VC++ application to VB GUI. For VB comunication to VC++ I have created a dispinterface with COM but now I need to create a dual interface with COM and I know how to do it? Thanks.
|
|
|
|
|
I want to be able to control printing to some print queues by
manipulating the spooler files directly. There are two files in a print
job: The .SPL file (which is the actual print job) and the .SHD file
(Shadow file). The .SHD file is the header file with all information about
the print job (User/Name/size/etc...).
Does anyone know what the file format for the .SHD file is? Or can
anyone point me to a location to look for the file structure definition?
Grtx,
Berry
|
|
|
|
|
Hello. I am a VC++ novice. Now I need to save a screen capture bitmap into a JPEG file. How can I do it? If you can post the source code, it will be very grateful. Thanx
Kidd
|
|
|
|
|
GDI+ does it with ease, CodeGuru has classes to do it, and paintlib ( www.paintlib.de ) also does it for a variety of formats.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Oh, Thank you so much. I surfed the website and found paintlib can realize the transformation. If I want the pure source code but not the DLL and library, where should I refer to? Thanx.
|
|
|
|
|
Paintlib comes with all the source code and also compiles linked in so you don't need to carry a dll. The actual source comes from the jpeg group and is a different library in the pintlib project. This is the same jpeg source everyone uses, AFAIK. The link is in the paintlib links page to just get that code.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Hello, Christian
It is said the lib can transform the 8-bit and 24-bit bitmap file to jpeg file. But it seems only 8-bit is supported. So many features lost. Thank you. And can I save a bitmap in the memory but not a file to jpeg file? Thanx.
|
|
|
|
|
This is not so - I save 24 bit JPEG's all the time using my program, which uses Paintlib.
Yes, use the JPegEncoder class to save an image from memory, but it needs first to be a CBmp derived format, like CDIBSection ( which can be created from a HBITMAP )
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Yes, You are right. I can save it to 24 bit now. But if I want to save it to ture color, how could I? You really gave me great helps. Thanx
|
|
|
|
|
24 bit IS True Colour. 32 bit includes 8 bits of alpha, which BTW Paintlib appears to support but does nothing with, but in any case add nothing to the colour depth.
I'm glad I've helped.
Alex
|
|
|
|
|
Oh, I see. But a still a problem. I can not save this 32 bit bmp file in to Jpeg file. It said the program only support 8 bits and 24 bits bmp files. Thanx
|
|
|
|
|
Yes, You are right. I can save it to 24 bit now. But if I want to save a ture color bitmap to JPEG, how could I? You really gave me great helps. Thanx
|
|
|
|
|
Yes, You are right. I can save it to 24 bit now. But if I want to save a ture color bitmap to JPEG, how could I? You really gave me great helps. Thanx
|
|
|
|
|
The source code is in the full paintlib distribution ( actually, it's in the extra code you need to download, linked from the paintlib site ). The .lib and .dll are not distributed, you actually build them from the source you download from paintlib.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
If use the following codes, after write DIB to BMP file, it is 32 bit file. But I need 24 bit BMP file.
CBitmap bitmap;
CClientDC dc(pWnd);
CDC memDC;
CRect rect;
memDC.CreateCompatibleDC(&dc);
pWnd->GetClientRect(rect);
bitmap.CreateCompatibleBitmap(&dc, rect.Width() , rect.Height() );
CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
memDC.BitBlt(0, 0, rect.Width(), rect.Height(), &dc, 0, 0, SRCCOPY);
So I changed the codes to these to save to the 24 bit file. But I got nothing.
CBitmap bitmap;
CClientDC dc(pWnd);
CDC memDC;
CRect rect;
memDC.CreateCompatibleDC(&dc);
pWnd->GetClientRect(rect);
bitmap.CreateBitmap( rect.Width(), rect.Height(), 1, 24, NULL );
CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
memDC.BitBlt(0, 0, rect.Width(), rect.Height(), &dc, 2, 27, SRCCOPY);
|
|
|
|
|
You can't select a bitmap of different depth to your DC. To select an image of the depth you want into any DC, use a DIBSection. The above would work if your screen was in 24 bit mode, but the way to make it work always is to create a CDIBSection ( a paintlib class ) and make it 24 bit, then select into your DC.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Hello, Christian
I am trying to install the paintlib. But after I extracted the paintlib23a.zip, I did not find the directorys of bin, lib and obj which listed in the directory structure in the document. And did I must download the PaintX and extract it to the paintlib fold? Sorry for so many problems. But I do need your help. Thanx
|
|
|
|
|
You don't need PaintX. If you follow the detailed instructions on the paintlib page, you'll find you need to move and rename some files and then when you do a build you will end up with the bin, lib and obj files. You'll get compilation errors, you can probably ignore them. Also, I change the project to call the debug version paintlibd.lib, otherwise you get trouble with your link paths later on.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Oh, After compliling, I found these directory. But so many errors
|
|
|
|
|
Assuming you renamed the files according to the instructions on the web site, the errors are to do with VC parsing stuff inside #ifdef's, which don't get compiled because they are for other compilers/OS. You should still have the .lib files, which means it compiled OK. Try the diblook sample to see.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Such as E:\Downloaded Application\Extracted\Paintlib\paintlib\otherlib\libjpeg\jinclude.h(60): Could not find the file strings.h.
E:\Downloaded Application\Extracted\Paintlib\paintlib\Otherlib\libjpeg\jmemsys.h(133): Could not find the file Files.h.
Build : warning : failed to (or don't know how to) build 'E:\Downloaded Application\Extracted\Paintlib\paintlib\otherlib\zLib\zutil.c'
Build : warning : failed to (or don't know how to) build 'E:\Downloaded Application\Extracted\Paintlib\paintlib\Otherlib\Libtiff\libtiff\tif_zip.c'
Does that mean I have to download all the other libs such as zLib and Libtiff although I need only libjpeg.
|
|
|
|