|
What function/message shall i use?
|
|
|
|
|
For non-MFC apps, look at the BM_GETCHECK and BM_SETCHECK messages.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
|
I am planning to write the distributed C++ MCSD exam. Now I noticed that the books have all been discontinued (the MS Press books for it), but the exam isstill there and is not listed amonst exams that will be discontinued. Do you guys think that this exam will be around in the 6 months or so, or do you see it phase out within this year?
|
|
|
|
|
Hey guys, I've got one that I hope someone can help with:
Over on codeguru.com there is an article titled Separating the views of an MDI application into different DLLs
What I'm trying to do is create this same fucntionality within a SDI application. This app is workflow based and using an MDI just doesn't work for this type of application.
Here's some of what I have; In my DLL, I have exported one function:
extern "C" AFX_EXT_API UINT Init(CString *strLabel,CRuntimeClass **pRunTimeClass)
{
new CDynLinkLibrary(View1DLL);
*pRunTimeClass = RUNTIME_CLASS(CTestView);
*strLabel = "View 1";
return 0;
}
In my test application I have a menu that will call this method when selected:
void CMainFrame::OnViewSwitchtodll()
{
HINSTANCE hDLL;
LPDLLFUNC lpfnDllFunc;
UINT uReturnVal;
CString strLabel;
CRuntimeClass* runtimeclass;
hDLL = LoadLibrary("View1.dll");
lpfnDllFunc = (LPDLLFUNC)::GetProcAddress(hDLL,"Init");
if (!lpfnDllFunc)
{
FreeLibrary(hDLL);
}
else
{
uReturnVal = lpfnDllFunc(&strLabel,&runtimeclass);
CAADoc* pDoc = (CAADoc*)this->GetActiveDocument();
pDoc->SwitchToView(runtimeclass);
}
}
This loads up the DLL grabs a function pointer to the Init function exported in the DLL and then passes the runtimeclass to the SwitchToView() in my Document class (this was taken from an article on CodeProject).
When I step into SwitchToView the runtimeclass object appears to be fine... and I do not receive errors... but the mHwnd of the runtimeclass is ??? in the Variable inspector during debug.
I've come to the point where I need someone else to take a look at this - so any help?
Thanks in advance,
Dave "Dak Lozar" Loeser
|
|
|
|
|
I have two views in my application . One is rich edit view and one is edit view . They are split using the splitter windows . But the edit view by default has horizontal and vertical scroll bars associated with it. How to get rid them and make them auto vertical and horizontal scroll bars. I have overriden the precreatewindow function of edit view with the following code
cs.style &= (WS_CHILD | WS_VISIBLE );
cs.style &= ~(WS_HSCROLL);
cs.style &= ~(WS_VSCROLL);
cs.dwExStyle &= ~(WS_EX_RIGHTSCROLLBAR);
but to no avail . Can anyone suggest a solution
|
|
|
|
|
Hi,
I'd like to know if anyone can give me some tips about how to programme in C++ a simple class for downloading a file from a web site, for example an image file. I want to incorporate this class into a project, so it does not need any flashy GUI or anything similar.
If possible, it would be good to avoid MFC classes because I need portability across windows/linux. My network programming is not up to scratch for this project that I have set myself.
Can one use an HTML GET call? Do I have to basically write a ftp client?
Any hints, tips, links, or book references would be great! I've already had a look on the web, but most implementations seem to use MFC
Thanks,
James
|
|
|
|
|
Here you go:
bool downloadUrlToFile
(CString strUrl,
CString strFilename)
{
HRESULT hResult = ::URLDownloadToFile (NULL, strUrl, strFilename, 0, NULL);
return (hResult == S_OK);
} Also see my WebResourcrProvider article.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
::URLDownloadToFile requires Internet Explorer 3.0 or higher. I do not think that this is a portable solution.
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!
|
|
|
|
|
You're right, but he'll probably have many other problems to worry about if he's running on a system with < IE3.0!
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
|
derfel wrote:
Can one use an HTML GET call?Yes, that's exactly what you must use to download something from a web server. Do I have to basically write a ftp clientNo, you must write a http client. See the Winsock FAQ to see how to do socket communcations without MFC. Winsock 1 calls (the ones without WSA prefix) are easily portable to Linux (they are based on Unix socket functions).
|
|
|
|
|
Thanks for the help everyone...kind of got something hacked together
|
|
|
|
|
with GetTcpTable & GetUdpTable you get the same result as netstat -an from the commandline.
On XP ,netstat have another flag -o which display the PId that associates with the Tcp/Udp port
how to accomplish that ? any ideas ?
|
|
|
|
|
Does anyone know how to register an ActiveX Control on another pc automatically without requesting the user to do it by him/herself?
is InstallShield capable of registering an ActiveX Control in setup.exe? but how? What should i do? do i need to write script for it?
When i send release of my app to my friend which includes an .ocx file they are compelled to register (many of them don't know how to do it as well by using Regsvr32.exe) it before starting the app.
Thanks for ur help..
Atilla Selem
just listening to you...
|
|
|
|
|
Yes you need to execute the DLLRegisterServer function
#include <stdole.h>
typedef HRESULT (STDAPICALLTYPE *CTLREGPROC)() ;
HMODULE hModule = ::LoadLibrary(m_strPathName) ;
CTLREGPROC DLLRegisterServer =
(CTLREGPROC)::GetProcAddress(hModule,"DllRegisterServer" ) ;
DLLRegisterServer() ;
::FreeLibrary(hModule) ;
Best Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
that's great...it has worked!,
thanks for ur help Mr.Antollini...
Best Regards,
Atilla Selem
just listening to you...
|
|
|
|
|
Another problem with distrubuting my application is that Mr.Antollini.
i tried to use MFC ODBC classes to keep some user information. And whenever they need to search someone they would have easily connected a DSN and got the info. But i realized that that would need them to create an ODBC connection in their local but again it needs help (as in ActiveX..)
is there a way for making a ODBC Data Source connection by coding inside the app?
That would really solve one of my distrubuting problem Mr.Antollini
Thanks for ur help,
Yours respectfully...
Atilla Selem
just listening to you...
|
|
|
|
|
Yes, No problem with that...
You need to use the function SQLConfigDataSource
SQLConfigDataSource(NULL,ODBC_ADD_DSN,
(LPSTR) "Excel Files (*.xls)",
(LPSTR) "DSN=New Excel Data Source\0"
"Description=New Excel Data Source\0"
"FileType=Excel\0"
"DataDirectory=C:\\EXCELDIR\0"
"MaxScanRows=20\0");
Carlos Antollini.
www.wanakostudios.com
Sonork ID 100.10529 cantollini
Best Regards....
|
|
|
|
|
My problem is the following. I've based myself on a document writen by Microsoft on how to print with the webBrowser Control. So I've been able to specify my desire settings like paper size and paper orientation. But my ultimate goal is to restore the original settings once I am finished. I've created a function that backups the settings and work fine and a restore function that restore my settings that works fine too. But the problem is that when it is executed the print dialog is still open and thus the restore function wont work. So far my only way arround it is to have a button call this function, but I don't want that, I want it to do that automatically.
The article I used is called Printing with the Internet Explorer WebBrowser Control written by Dave Templin. I am using the wp_print03 example.
Thank you
|
|
|
|
|
i have painted a big image on a smaller in size windowless control, how do i make the user scroll the image in the control
|
|
|
|
|
Hi,
I just want to know that if I could get a view's DC from the Doc class?
how to do it?
anyone konws?
thank you.
YES, I am here.
|
|
|
|
|
I assume that you must have access to the views from the document. If so, simply instantiate a CClientDC passing it the desired view pointer.
Cheers,
Tom Archer
Author - Inside C#, Visual C++.NET Bible
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the af
|
|
|
|
|
Look the article Q108587 - "HOWTO: Get Current CDocument or CView from Anywhere" in MSDN
Best regards,
Eugene Pustovoyt
|
|
|
|
|
Can anyone recommend a good CDatabase/CRecordset clone which doesn't use MFC?
Alternatively, can you recommend a different technology (ADO or something) which is independant of MFC?
Cheers
James Spibey
I love the word naked, it's brilliant isn't it, 'naked'. When I was a kid I used to write the word naked on a bit of paper hundreds of times and rub my face in it - Jeff, Coupling, BBC2
|
|
|
|