|
I answered to you but you asked again?
|
|
|
|
|
Hi all,
I wrote a database dll. The dll exports the whole class.
i.e.
#ifdef STATIC_LIBRARY
#define DLL_IMPORT_EXPORT
#else
#ifdef WIN32
#ifdef DBMODULE_EXPORTS
#define DBMODULE_API __declspec(dllexport)
#else
#define DBMODULE_API __declspec(dllimport)
#endif
#endif
#endif
class DBMODULE_API Database
{
...
class DBMODULE_API Recordset
{
But when I try and get hold of the class constructor in my calling application, I receive linker errors.
i.e.
...
Database db;
Recordset rs = Recordset(&db);
...
Can anyone please help me?????
Many Thanks
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
|
Hello,everyone ,I'm here for your help.I wanna show a jpg picture with a picture control.At the same time, I want to use GDI (to draw)on the control,How can i do this?Thanks a lot.:-DThe sample will be appreciated.
|
|
|
|
|
Your best bet would probably be to render the JPG to a memory bitmap, then draw on the memory bitmap with GDI and display the result in the Picture control. The down side of this is you'll need to be able to un-jpeg the jpeg without the help of the control. Another option would be to subclass the control, override its handling of WM_PAINT to do the original painting and then add your own. There are lots of subclassing examples and tutorials about on CP and elsewhere.
No sample I'm afraid, it would be quite a lot of code and I'm notoriously lazy .
You could provide more details though of which picture control/language/libraries you're using. Someone out there is bound to have hit the same hurdle.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Except GDI you can use of this code
#include AtlImage.h
CImage m_Image;
m_Image.Load("c:\\file.jpg");
m_Control.SetBitmap(m_Image.Detach());
|
|
|
|
|
In additional see OleLoadPicture and on the codeproject see CXImage article,that article will be helpful for you.
|
|
|
|
|
Hi all
i am new in VC++.
could you please suggest how can i read a file or check file on internet on a remot system i am using http protocol to connect the system.
I have already tried this
<br />
HINTERNET hSession = InternetOpen( "HttpSendRequestEx", INTERNET_OPEN_TYPE_PRECONFIG,<br />
NULL, NULL, 0);<br />
<br />
<br />
HINTERNET hConnect = InternetConnect(hSession, argv[1], INTERNET_DEFAULT_HTTP_PORT,<br />
NULL, NULL, INTERNET_SERVICE_HTTP,NULL, NULL);<br />
<br />
<br />
HINTERNET hRequest1 = HttpOpenRequest (hConnect,NULL,<br />
upFolder, NULL, NULL,NULL,0, 0);<br />
if (HttpSendRequest(hRequest1,NULL,0,NULL,0))<br />
{<br />
while(InternetReadFile(hRequest1, &buffer, 1, &dwRead )==TRUE)<br />
{<br />
if (dwRead !=1) break;<br />
putchar(buffer);<br />
<br />
}<br />
}
But when the file does not exist on the remote system this code read the file. could u please suggest why it is happining.
There is any other alternative to check the file please suggest.
Saurabh Gupta
Software Engineer
|
|
|
|
|
Hello,
I am working on a application which runs in Window Mode. I am using Visual Studio 2003 for the developement. Following Setting control the mode of application...
Project Settings->Linker->System->SubSystem == Windows.
My task is to add some command line functionality in it. To make it possible I changes the above mentioned property to Console.
Project Settings->Linker->System->SubSystem == Console.
Now I am able to add the Command Line functioanlity and it is workign fine. Only probelm I am facing is that whenever I launch the GUI application a command window also launches. this behavior is quite obvious as application is a console one.
But I want to change this behavior, I do not want console window when I launch GUI and also want to keep the console functioality.
Here I would like to mention that, Conasole and Window version of the applicaion is mutually exclusive of each other and can not be used at the same time.
Thanks
Vikrant.
|
|
|
|
|
I would tackle this by leaving the application as GUI (SubSystem==Windows) application but if you want a console instead of a main window create one with the BOOL AllocConsole(void); API and don't call CreateWindow . Any user will not be able to tell that it isn't a 'real' console app. I hope this helps
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Let me explain the problem...
Lets say name of application is MyApp.exe. SO following is the behavior I want.
On Command Prompt
C:\MyApp \\This will Launch the GuiClient
C:\MyApp -Help \\This will list out the all of the commands supported by command line version
C:\MyApp -Command1 \\This will execute the command and show the result on console
Above mentiotned functionality is working fine if I make it a console application. If I make it a Window Application user will not ba able to alunch it from Console. But After making it a console application whenever I try to launch the windows version (i.e. By Double clicking EXE) a console window is also launched.
I do not want this Console window.
I hope I explain the issue.
|
|
|
|
|
OK. If you make it a Console App you get a Console and you can't stop this as far as I know.
If you make it a Windows App and check the command line in WinMain then choose to call the CreateWindow GUI code for some commands and AllocConsole console code for other command lines then you have options 1, 2 & 3 covered.
What I don't see is why the user won't be able to run it from the command line. Windows deals with this just fine, try opening a command prompt and typing 'notepad' and you'll see what I mean. Is there some other reason why it won't launch like not being able to find dependent dlls?
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Hi all,
I want to access a remote database using mfc which is in a linux machine.. Any clue?
Thanks in advance
Vikas s
With Reagards
Vikas
|
|
|
|
|
Vikas_123 wrote: mfc which is in a linux machine..
MFC on a Linux machine? Great!!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
its thr remote datqabase thats in the linux amchine .. mfc apppplication runs on windows only!
With Reagards
Vikas
|
|
|
|
|
From the MFC end you'll probably need to use ODBC. As far I know there aren't any OLE/DB (ADO) backends for linux based databases but anyone is welcome to tell me otherwise. Then you'll need an ODBC drive that talks SQL to a remote database. One specifically for the database you're using would be good but sometimes more general drivers can be persuaded to work with different SQL databases. Essentially the link between the two has to be SQL, the only common language, over TCP/IP, the only common communication medium. You may need the database queries wrapped up as HTTP Gets or even SOAP packets depending on what services are layered on top of your Linux database. If the database has a Web based front end you might even be able to get Remote Data Objects (RDO) to work. It's an old Micorsoft technology, probably no longer supported but that doesn't mean it won't work. Either way it's probably not going to be easy. I'd consider investing in some middle-ware designed to do this sort of thing for you. There's lots of it about. Good luck.;)
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Hi,
I have an ActiveX Plug-In developed using MFC, which gets loaded into a website. On one particular button click(When session is expired), I want to navigate to a "Login" page in the same browser instance.
I am using following code:
IOleClientSite *pClientSite = NULL;<br />
pClientSite = COleControl::GetClientSite();<br />
<br />
IOleContainer* pContainer = NULL;<br />
CComQIPtr spDoc(pContainer); <br />
<br />
pClientSite->GetContainer( &pContainer );<br />
if ( pContainer != NULL )<br />
pContainer->QueryInterface(&spDoc); <br />
<br />
BSTR websiteUrl = loginURL.AllocSysString();<br />
if (spDoc)<br />
{<br />
spDoc->put_URL(websiteUrl);<br />
}
Using above code, the page gets navigated to the login page. but the Header part remains as it is. and the address bar still shows the previous URL.
Can anybody help me to resolve this issue?
Thanks in advance,
Vrushali
|
|
|
|
|
Hi,
I have an ActiveX Plug-In developed using MFC, which gets loaded into a website. On one particular button click(When session is expired), I want to navigate to a "Login" page in the same browser instance.
I am using following code:
IOleClientSite *pClientSite = NULL;<br />
pClientSite = COleControl::GetClientSite();<br />
<br />
IOleContainer* pContainer = NULL;<br />
CComQIPtr<IHTMLDocument2, &IID_IHTMLDocument2> spDoc(pContainer); <br />
<br />
pClientSite->GetContainer( &pContainer );<br />
if ( pContainer != NULL )<br />
pContainer->QueryInterface(&spDoc); <br />
<br />
BSTR websiteUrl = loginURL.AllocSysString();<br />
if (spDoc)<br />
{<br />
spDoc->put_URL(websiteUrl);<br />
}
Using above code, the page gets navigated to the login page. but the Header part remains as it is. and the address bar still shows the previous URL.
Can anybody help me to resolve this issue?
Thanks in advance,
Vrushali
|
|
|
|
|
Hello All,
I have images in .PNG format to be used in my Buttons in my dialogs and forms. When I tried to use the CBitmapButton it is expecting the images in .BMP format. When I tried to convert the image the color of image changes . TIF format gives almost similar look and feel when converted from PNG format.
Let me know how to use PNG / TIF images for my button.
I have few images in PNG format to be used as background of my dialogs also. Let me know how to use PNG files as back ground of the dialog box.
Thanks in Advance
Blr Boy
|
|
|
|
|
Maybe also that your image converting tool is poor, try IrfanView, it's great.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
if you want to load ong or gif files you can use of CImage class.
|
|
|
|
|
hi i am using visual studio 2005 to create an msi file and then i install it through my mfc program. when i click the minimize button the package minimized but the image still alive in screen. what to do this. pls help me.
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Hi all
I am looking forward to learn MFC and write a windows application in it asap.
Can any one pls refer me some good complete tutorial sites. I refered one site but that was real confusing as they were like coding for every buttons like win32. So i dont want to code for any tools. I prefer drag n drop in that case...
Pls let me know of any good ol tutorial...N YEH FOR VS2005. I guess there is some difference in VC6 and VS2005.
Thanks
SS
|
|
|
|
|
log on to MSDN[^. You can find lots of tutorials and articles there
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|