|
hi, below was my sample coding for my application
//this is my InetSession
m_pInetSession = new CInternetSession(
NULL, 1,
PRE_CONFIG_INTERNET_ACCESS );
// If the CInternetSession object didn't
// allocate, bail out.
if(m_pInetSession == NULL ){
return( 0 );
}
//ftp connection
m_pFtpConnection = m_pInetSession->GetFtpConnection(
"127.0.0.1", "", "");
what i did here is i m running an ftp server on my local host. The ftp server is a shareware program that will enable any ftp client connect to u local host without networking environment. i did try to connect to my local host by using FTP explorer shareware. its works fine. i just want to prove that my ftp server shareware is working fine. Next, i try to compile n run my application, the results were, the first was ok, but when i try to run on the second time its failed. i also try to run my application on a network environment, it was failed too !
I did refer to the MSDN FTPTREE sample program, its works fine. i try to copy out some part of the code to my application, but it was fail!
I totally have no idea what to do next, please HELP !!!
Thanks !
|
|
|
|
|
Hi
Just a guess as to why your copied and pasted code
doesn't work !
Have you made sure you statically linked your code correctly, eg included uuid.lib in
Project->Settings->Link->Object/Library modules "uuid.lib "
Its a common problem
Regardz
Colin Davies
|
|
|
|
|
if (!AfxParseURL(strFtpSite, dwServiceType, strServerName, strObject, nPort))
{
// try adding the "ftp://" protocol
CString strFtpURL = _T("ftp://");
strFtpURL += strFtpSite;
if (!AfxParseURL(strFtpURL, dwServiceType, strServerName, strObject, nPort))
{
AfxMessageBox("IDS_INVALID_URL", MB_OK);
return;
}
}
hi,
i managed to solve this problem. Just add the above code right after the InteenetSession, then it will work fine.
I ve tried it out!
|
|
|
|
|
if (!AfxParseURL(strFtpSite, dwServiceType, strServerName, strObject, nPort))
{
// try adding the "ftp://" protocol
CString strFtpURL = _T("ftp://");
strFtpURL += strFtpSite;
if (!AfxParseURL(strFtpURL, dwServiceType, strServerName, strObject, nPort))
{
AfxMessageBox("IDS_INVALID_URL", MB_OK);
return;
}
}
hi,
i managed to solve this problem. Just add the above code right after the InteenetSession, then it will work fine.
I ve tried it out!
|
|
|
|
|
if (!AfxParseURL(strFtpSite, dwServiceType, strServerName, strObject, nPort))
{
// try adding the "ftp://" protocol
CString strFtpURL = _T("ftp://");
strFtpURL += strFtpSite;
if (!AfxParseURL(strFtpURL, dwServiceType, strServerName, strObject, nPort))
{
AfxMessageBox("IDS_INVALID_URL", MB_OK);
return;
}
}
hi,
i managed to solve this problem. Just add the above code right after the InteenetSession, then it will work fine.
I ve tried it out!
|
|
|
|
|
Hi,
I'm trying to put a number of CRichEditCtrls into a CView. The control displays ok and I found some code in the MSDN about how to print the control. However in Print Preview the text always appears as it's final size, ie not the same size as other text (in the same font and size) on the CView.
Any ideas on what I've forgotten to do?
Thanks Tim Brown
|
|
|
|
|
Where I can get source code ?
|
|
|
|
|
Hello, Codegurus.
We can find the source codes from a couple of places.
1)www.codejock.com
Try to find SDIExplorer example in CJLibrary.
2)Mfcie example of MSDN library of Microsoft.
If you don't have MDSN Library CD, try to find
Mfcie of search of Microsoft web site.
HTH.
-Masaaki Onishi-
|
|
|
|
|
I developed several class using unix g++ compiler. I developed
one class in particular, called CEditString, that edits string
pointers. Every other class that I created uses this CEditString
class. At the top of all these other classes, I type
#include "EditString.H"
and within that class I type
public:
CEditString EditString;
The problem is, when I compile, I get the following error:
/code/EditString.H: In method `CEditString::CEditString()':
In file included from /code/AtomLocation.H:11,
from /code/ProteinStructure.H:13,
from topView.C:7:
/code/EditString.H:56: redefinition of `CEditString::CEditString()'
/code/EditString.H:56: `CEditString::CEditString()' previously
defined here.
I know that I am redefining the class, but if I don't redefine,
then I get that error that 'CEditString' undeclared. This is
really frustrating. Is there any way of destroying the class
so that when I do call it, I am not redefining it?
Please, any response any one can give me will be greatly
appreciated.
Sincerely,
Erich J. Ruth (an overworked graduate student)
|
|
|
|
|
Hello, Codeguru.
We can use predefine class name in this case.
/*#include "EditString.H"*/
class CEditString;
and within that class I type
public:
CEditString EditString;
HTH.
-Masaaki Onishi-
|
|
|
|
|
That won't work. If you "forward declare" a class (eg, "class CEditString;") you may only use it for pointers and references until the full declaration is given.
|
|
|
|
|
Hello, James.
I already noticed this with Mr. Hamishi post.
But, simply just change CEditString string -> CEditString* string ,and '.' -> '->'.
I think that this is more normal in C++ coding.
Regards.
-Masaaki Onishi-
|
|
|
|
|
Is it possible that within one compile unit, you have #included the EditString.h file twice? Just hazarding a guess here? If that's the case, you should add the following two lines at the start of the EditString.h file;
#ifndef EDITSTRING_H
#define EDITSTRING_H
...
...
...
rest of file and then at the very end of the file add this line
#endif // for the EDITSTRING_H
HTH.
|
|
|
|
|
Hi,
If all the other classes use the one class, just #include that file in stdafx.h. That way it will be available to
all the other classes. What you have here is called 'circular reference', where one header file gets
included more than once. As the replies suggests, you can prevent this multiple inclusion by using
#ifndef .... #define.....or use a 'forward declaration' in the header file by writing 'class CEditString'. Forward
declarations, however, are only allowed for pointer members. That is, you can say CEditString* stPtr
and not CEditString obj. What I usually do when I have a problem like this is draw a diagram showing
what files have included what, and then I can figure out a way not to include a file more than once. If
this doesn't help you then send me your whole project (syh@ufl.edu) and I'll be glad to look at it for
you. I know how frustrating this can be. Good luck.
sayed hashimi (another overworked graduate student).
|
|
|
|
|
hi,
I have a MDI app with a CRichEditView and Doc. I would like to know how I can everytime i create a new document open a Text File that i created.
This text file is a kinda report where i fill later on.
I use this text as a Template for my file.
Here is my code
void CMainFrame::OnFileNewProject()
{
// TODO: Add your command handler code here
CNewProjectDlg dlg;
if (dlg.DoModal() == IDOK)
{
if(!dlg.m_strProjectName.IsEmpty())
{
PrepareEnvironment(dlg.m_strProject, dlg.m_strProjectName );
//Update Project View
m_pDocProject->AddItem2View(dlg.m_strProjectName);
//Create a new document
CCosmoSQAApp* pApp = (CCosmoSQAApp*)AfxGetApp();
pApp->m_pDocTemplate->OpenDocumentFileNULL, TRUE);
}
}
}
Thanks
olivier
|
|
|
|
|
Hello,
I want to create a new browser as a child window of existing one? Can i do that? Any ideas??
I am using IWebBrowser2 interface. But it opens my page into default browser.
regards,
Mahesh
|
|
|
|
|
Since you are using the Internet Explorer browser control, you can insert an IFRAME HTML tag set into your existing web browser control and have the iframe navigate to the page you want.
use innerHTML method and then call execScript with code to have the IFRAME navigate elsewhere.
It's one way.
-Erik Thompson
|
|
|
|
|
Thanks Erik,
Is there any way without frames? My requirement is not to use frames.
|
|
|
|
|
Dear Mahesh,
There are events that the WebBrowser control emits, which you can handle by implementing the DWebBrowserEvents2 dispatch interface in your program (or something, I forget ).
The event OnBeforeNavigate or OnBeforeNavigate2 (I forget again ) are called or fired after the Navigate() method is called but before navigation begins. It is passed parameters like the URL, do we want to cancel, so forth.
What I would do is to put new child-window-creation code in there, and pass the URL to the new window, which itself could contain a WebBrowser control.
Cheers,
Brian Hart
|
|
|
|
|
Hi,
I'm working on a offline type browser,
for the Downloading of the Content I'm trying to find away to have the downloads occur as low priority, as not to interuppt a users other internet activity,
Any clues as to how this might be done ?
Regardz
Colin Davies
|
|
|
|
|
Colin,
I don't think there is any way to specifically adjust the priority of a socket, but I do believe that Microsoft's networking subsystem automatically adopts the priority of the thread that makes the network request. I think you can probably achieve what you're looking for by either adjusting your application's priority, or, if it is an interactive process, by spinning off a worker thread and lowering that thread's priority.
(I am however shooting from the hip and may be completely wrong
|
|
|
|
|
I think your hip might have good alignment
and setting a "low" level priority might work.
I've also recieved some info about a "TCP window" which is somesort of buffer, you make the window/buffer smaller and the priority decreases, But I fear TAPI/Winitet Like I fear contagious diseases
Regardz
Colin
|
|
|
|
|
Hi,
I had make a CAB file which contains two files
NYPDesk.dll (a deskband working perfect)
nyp.inf
my nyp.inf contains:
===========x============
[Version]
; This section is required for compatibility on both Windows 95 and Windows NT.
Signature="$CHICAGO$"
AdvancedInf=2.0
[Setup Hooks]
hook1=hook1
[hook1]
; run=%EXTRACT_DIR%\setup.exe --activex
run=c:\windows\system\regsvr32 %EXTRACT_DIR%\myBands.dll
==========x=============
I had used <object> tag in the html page. Look like below
<object id="test" classid="CLSID:55555555-5555-5555-5555-555555555555" codebase="test.cab" align="baseline" border="1" width="5" height="5">
Problem:
After opening the html, IE5 displays the error message
"Your current security setting prohibit running ActiveX controls on this page
As a result, the page may not display correctly"
I had enabled all the ActiveX contorl in the Options. but the problem
still exist
Actually, This is my first experience to install the components via IE.
Please provide some good solutions.
TIA
Regards,
SaRose
|
|
|
|
|
Hi!
You must make your control safe for scripting and initializing using the IObjectSafety interface. If you did not do that it can cause problems...
Check the MSDN article "Internet First Steps: Upgrading an Existing ActiveX Control" for more details.
Regards,
Alex Gorev,
Dundas Software.
|
|
|
|
|
I want to dill with the uparrow down message, I tried to use
OnKeyDown and OnSysKeyDown ,but when the user pressed the uparrow both of the two function is not called ,why? please help me!
thanks a lot!
|
|
|
|
|