|
Are you using 'raw' OLEDB or ATL Consumer Templates?
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Hi,
How can load *.gif or *.jpeg files on a dialog or a button, if i can please tell how it is .
Thank U very much.
|
|
|
|
|
you cannot use GIF without a license (in the US, Germany, UK, Japan, etc.).
if you want to load JPG, there are articles on this site (see the Bitmap and Palettes section). or you could try a 3-rd party toolkit, like ImgSource.
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
Try use function OleLoadPicturePath
According to documentation:
The stream must be in BMP (bitmap), JPEG, WMF (metafile), ICO (icon) or GIF format
|
|
|
|
|
Here you go.
You have to declare some CBitmapButton objects for each button in your main class header file that you are using this buttons.
Then add the usually message handlers.
Load your bitmap picture in your resource bitmap and use a string name "Name" to label your bitmap that you want over your button.
Then that should be the same name as the caption on your button. Make sure you have owner draw button checked.
Add a OnInitDlg member function and call your CBitmapButton objects with autoload.
Compile and run and you should have your bitmap buttons.
|
|
|
|
|
Hello,
when i import msado15.dll i do not get _RecordsetPtr. I can use _Recordset but i do not know how to get item data. i found in the samples the code but it always uses _RecordsetPtr.
how can i get _RecordsetPtr ? or what is eqivalent usage of _Recordset to the _RecordsetPtr's call:
_RecordsetPtr Rs1;
variant = Rs1->Fields->GetItem
(_variant_t ("name"))->Value;
thank you
|
|
|
|
|
Hi All,
Is there any parser which will convert rtf text to html text.
with regards
A.Santosh
|
|
|
|
|
I'm using Chris Maunder's grid control in an MDI app (*non* Doc/View). I added a grid pointer in my ChildFrm.h and create / initialise it in CChildView::Create(). No problems here.
Assuming I have a file that can be read into the grid, how do I access the grid from within the open call in CMainApp::OnFileOpen() or CMainFrame::OnFileOpen() to put that data into it?
I have no problems with the new call because I don't need to modify the grid before I show it to the user. With open I do need to modify it first (load it with data). How do I do this?
|
|
|
|
|
With an MDI app you need to make OnFileOpen in the App class query for a filename and then call the doc class, similar to this:
if (dlg.DoModal() == IDOK)
{
AfxGetApp()->OpenDocumentFile(dlg.GetPathName());
}
Then in the Doc class you can override OnFileOpen to call this function ( as once you have opened one file, the Doc version gets called instead ) like this:
CMyApp * pApp = (CMyApp*)AfxGetApp();
pApp->OnFileOpen();
Finally, override OnOpenDocument to open the file, read the data and set some sort of flag to be used in your views OnInitialUpdate function to display the data.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
|
|
|
|
|
But I'm *not* using doc / view. This is just plain App Wizard generated with the doc / view support unchecked. Given that the grid control stores all data internally I see no reason to include that support when the CDocument is never going to be used.
I was thinking more along the lines of the code below. The only problem I see with this is that is doesn't work It compiles fine, but the view returned is NULL. Where am I going wrong here???
void CMainApp::OnFileOpen()
{
CMainFrame* pFrame = STATIC_DOWNCAST(CMainFrame, m_pMainWnd);
CMDIChildWnd* wnd = pFrame->CreateNewChild(
RUNTIME_CLASS(CChildFrame), IDR_MAINTYPE, m_hMDIMenu, m_hMDIAccel);
CChildView* view = (CChildView*)wnd->GetActiveView();
view->c_pGrid->DoSomethingCool(); // Compiles but view is 0x0
}
|
|
|
|
|
Hi All,
I have aon interesting Query .I have an ATL Service and I want to display a Message say "Hi" in the Build window when I run the service.
Which Macro I have to use?
Thanx in advance for the help.
Regards,
Y.Yamini Devi.
|
|
|
|
|
do any have built the line custom control in MFC,
pls help by guiding me in building the custom line control, and also pls
suggest how to building round, hexagon control.
|
|
|
|
|
Please specify more detaily, what do You mean by line control?
To use non-rectangular control shapes, You have to read about regions. See CRgn class.
|
|
|
|
|
Hello,
I am trying to make my first dll. But I cant get it to work. The linker keeps saying it cant find what it needs.
MyTestApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall CMyTestClass::~CMyTestClass(void)" (__imp_??1CMyTestClass@@UAE@XZ)
MyTestAppDlg.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall CMyTestClass::~CMyTestClass(void)" (__imp_??1CMyTestClass@@UAE@XZ)
MyTestAppDlg.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall CMyTestClass::CMyTestClass(void)" (__imp_??0CMyTestClass@@QAE@XZ)
Debug/MyTestApp.exe : fatal error LNK1120: 2 unresolved externals
The DLL i created with the AppWizard (MFC DLL) as an extension dll.
The only change I made to the whole thing was I add a class (using the class wizard) as CMyTestClass. It Has one Memebr variable and the empty constructor and deconstructors the class wizard creates.
I create an .h file to include for my app.
The app is just a generic Dlg app made with AppWizard. It include the .h file for the lib.
The .h file conatins the class declaration as such:
class AFX_CLASS_IMPORT CMyTestClass
{
public:
CMyTestClass();
virtual ~CMyTestClass();
int m_Sh*t;
};
I moved the dll and .lib files to the Applications project directory so it could find them.
What am I doing wrong??
PLease help.
|
|
|
|
|
Hi
Use Win32 Dynamic-Link Library wizard with option "a dll that exports some symbols"
it makes some defines for you like these:
#ifdef MY_EXPORTS
#define MY_API __declspec(dllexport)
#else
#define MY_API __declspec(dllimport)
#endif
modify them a little:
#ifdef MY_EXPORTS
#define MY_API __declspec(dllexport)
#elif defined(_STATIC_MY_LIB_)
#define MY_API
#else
#define MY_API __declspec(dllimport)
#endif
and use MY_API before your classes:
class MY_API CMyTestClass {};
now your should define in dll-project (wizard made it for you) MY_EXPORTS
don't define any (MY_EXPORTS|_STATIC_MY_LIB_) in projects that use your dll
you can make lib-project using same source files just define _STATIC_MY_LIB_ in project settings.
ZMike.
|
|
|
|
|
Hi All,
I want to convert 16 grayscale BMP image to DOS 4-plane format image, in order to display
the BMP image on DOS screen.
Please give me some help. Thanks
|
|
|
|
|
In my work environment I deal with a lot of Access and therefore VB. But just creating standalone database interface applications, how much faster is VC++ accessing/querying a database as opposed to VB. What difference between DAO,ADO,ODBC,etc.
Cheers
Robbie G
|
|
|
|
|
VC++ won't be much faster accessing Access databases than VB. The database work is performed by Jet engine anyway. I believe that you could improve performance with large datasets by using OLEDB via ATL COnsumer Templates.
Keep in mind that OLEDB requires skilled C++ programmer. I wouldn't recommending this path if you just switched from VB to VC.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
I need to be able to (de)compress any file that comes in to my program. I use C/C++/Win32API/MFC 4.2. I would like the highest compression rate possible. I don't care to use libraies other than the standard libraies to use C/C++/Win32API/MFC 4.2.
How do I enable (de)compression in my program?
Any sites?
|
|
|
|
|
Actually, C++ is largely a superset of C, so you don't need to specify C/C++ - unless you intend on using one of the exception pieces of C code that don't work in C++, you are using C++ and that is that. Almost every C program is valid C++.
There are a number of options that rapidly slam shut with this line:
>>I don't care to use libraies other than the standard libraies to use C/C++/Win32API/MFC 4.2.
As MFC/Win32 do not come with any compression schemes, you can either renege on your desire not to use a library, or write your own. If you choose the former - check out zLib. If the latter, let us know how it turns out.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
|
|
|
|
|
I'm reading a binary file and at one point there are a couple of bytes (in hex) that contain the number of files in the archive. I put this information into a char array and then print it out as hex. When I display this number using VC++ it is 6670 when it should be 3610. The difference is apprently between using big edian and little edian numbers. The 6670 is big edian. How do I convert?
modified 12-Jul-20 21:01pm.
|
|
|
|
|
The difference is the order in which the bytes are stored. Big endian is MSB (the "big end") first, and little endian is LSB (the "little end") first. So just use the C bitwise operators to reverse the bytes.
WORD w = 0x13A5;
WORD wReversed = ((w & 0xFF) << 8) | ((w & 0xFF00) >> 8);
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
When using Win32 function OpenPrinter. I has three parameters. I just wanted to get a printer handle. I tried to open local printer so first parameter and third was set to NULL. The second printer was the printer handle returned. But When I did so, the printer handle is NULL.
Can you tell me to how to get this handle and how to pass the parameter properly?
Thanks
|
|
|
|
|
OpenPrinter(strPrinter, &hPrinter, NULL);
Where strPrinter is the Printer name. This name is the same that you see in the Printer Folder.
In Windows NT/2000 you can set this variable to NULL, this indicates the local printer server.
hPrinter is the HANDLE that returns the function.....
Is Simple. If don't work the problem is with the name of the printer
Cheers!!!
Carlos Antollini.
|
|
|
|
|
You can also create a CPrinterDialog ( or whatever it is called ) and get the PrinterDC from it, if you just want the default printer.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
|
|
|
|