Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
R

rbrad12345

@rbrad12345
About
Posts
12
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • WinInet FtpPutFile
    R rbrad12345

    Outstanding! Thank you! Ryan Bradley Systems Engineer Industrial Networks

    C / C++ / MFC sysadmin agentic-ai help

  • WinInet FtpPutFile
    R rbrad12345

    Hello everyone, I'm writing a simple class to handle FTP SEND of a file from a WinCE 4.2 box. I'm having some trouble with the FtpPutFile call. I've tried several FTP servers using a valid username & password and get the same error every time. InternetOpen succeeds, InternetConnect succeeds, FtpPutFile returns FALSE, GetLastError returns 12018. The error message 12018 is defined in WinInet.h as follows #define ERROR_INTERNET_INCORRECT_HANDLE_TYPE 12018 The type of handle supplied is incorrect for this operation. Any input is greatly appreciated! void CWinInetTestDlg::OnPut() { DWORD err = 0; CString str; HINTERNET hInternet = 0; // InternetOpen Params LPCTSTR agent = _T("FTP"); DWORD dwAccessType = INTERNET_OPEN_TYPE_PRECONFIG; LPCTSTR proxy = 0; LPCTSTR bypass = 0; DWORD flags = 0; // InternetConnect Params LPCTSTR server = _T("X.X.X.X"); INTERNET_PORT port = INTERNET_DEFAULT_FTP_PORT; LPCTSTR user = _T("user_name"); LPCTSTR pass = _T("password"); DWORD service = INTERNET_SERVICE_FTP; DWORD context = 0; // FtpPutFile Params LPCTSTR szLocalFile = _T("\\TEST.TXT"); LPCTSTR szRemoteFile = _T("\\TEST.TXT"); hInternet = InternetOpen(agent, dwAccessType, proxy, bypass, flags); if (hInternet) { //flags = INTERNET_FLAG_PASSIVE; flags = 0; if (InternetConnect( hInternet, server, port, user, pass, service, flags, context)) { flags = INTERNET_FLAG_TRANSFER_BINARY; if ( FtpPutFile( hInternet, szLocalFile, szRemoteFile, flags, context) ) { MessageBox( _T("FtpPutFile Success!"), _T("WinInet FTP Test"), MB_OK); }else{ err = GetLastError(); str.Format(_T("FtpPutFile Error: %d"), err); MessageBox(str, _T("WinInet FTP Test"),MB_OK); }//FTPPutFile }else{ err = GetLastError(); str.Format(_T("InternetConnect Error: %d"), err); MessageBox(str, _T("WinInet FTP Test"),MB_OK); }//InternetConnect if (!InternetCloseHandle(hInternet)) { err = GetLastError(); str.Format(_T("Error %d"), err); MessageBox(str, _T("WinInet FTP Test"),MB_OK); }//InternetCloseHandle }else{ err = GetLastError(); str.Format(_T("InternetOpen Failed with code %d"), err); MessageBox(str, _T("WinInet FTP Test"),MB_OK); }//InternetOpen } -Ryan Bradley

    C / C++ / MFC sysadmin agentic-ai help

  • eVC++ 4.0 to SQL Server 2000
    R rbrad12345

    Hello all! This is a duplicate from the SQL forum. It might be more suited for this forum. I've recently completed a Pocket PC application in VB.NET that works with connections to a local SQL Server 2000 CE DB and a SQL Server 2000 via WiFi. I'd like to look at doing the same thing using eMbedded Visual C++ 4.0 and OLE DB for a CE.NET device. While there are plenty of resources for SQL CE I can't find any for SQL Server 2000. Does anyone know of a good sample for eVC++ that hits both SQL CE and SQL Server? No ActiveSync and no IIS for this solution thus RDA and Merge Repl are of no value. Any input is much appreciated!

    C / C++ / MFC c++ database csharp sql-server

  • eVC++ 4.0 to SQL Server 2000
    R rbrad12345

    I've recently completed a Pocket PC application in VB.NET that works with connections to a local SQL Server 2000 CE DB and a SQL Server 2000. I'd like to look at doing the same thing using eMbedded Visual C++ 4.0 and OLE DB for a CE.NET device. While there are plenty of resources for SQL CE I can't find any for SQL Server 2000. Does anyone know of a good sample for eVC++ that hits both SQL CE and SQL Server? No ActiveSync and no IIS for this solution thus RDA and Merge Repl are of no value. Any input is much appreciated!

    Database c++ database csharp sql-server

  • IS LAUREN A BIGOT?
    R rbrad12345

    Since when is expressing hatred okay? A person's sense of religion is personal. And to insult religion generally is to directly insult MANY people. I must have missed the cursing in earlier posts :omg: Ryan Bradley

    The Lounge question

  • Not Supported Exception
    R rbrad12345

    This problem evolved through a couple of different error messages. The NotSupportedException was thrown when I passed a System.String ByRef to a BSTR in the non-COM DLL. I finally realized that I needed to use a StringBuilder. This resulted in a Native Exception (0xc0000005). Memory wasn't being marshalled properly between the unmanaged stack and the managed heap. Originally I was using <DllImport("")> and passing StringBuilder ByRef (resulting in Native Exception). I finally got this to work using Declare Function "" and passing StringBuilder ByVal. I've read through the CF Core Reference and numerous web sites but have not found the defaults that are different between using DllImport and Declare Function. I did find that MarshalAs is not possible in CF 1.1. I'm stumped why but it works. Dysfunctional: <DllImport("ReaderDll")> _ Public Function Read(ByVal strbData as StringBuilder) as Integer End Function Functional: Public Declare Function "Read" Lib "ReaderDll" (ByVal strbData as StringBuilder) as Integer Ryan Bradley

    Visual Basic csharp c++ help question

  • IS LAUREN A BIGOT?
    R rbrad12345

    If this forum is a suitable place for Lauren to say "... I just hate religion ..." then Lauren should be ready for those who disagree to do so with vigor and be prepared to discuss. How is we have come to defend such petty hatreds? :(( I believe it would have been better to say that "Is Lauren behaving like a bigot?" Less accusatory. Hopefully, all of us can see the futility of advocating hatred. Hatred is purely destructive yet most religions promote love and helpfulness. I just don't understand how one could hate such things. It occurs to me that it simply isn't possible to hate Religion. It is the failings of human beings that have brought the blemish to it's history all over the globe. Therefore, it must be a hatred of the people. A hatred of worshipers. People who see a rainbow and remember God's promise. We will only destroy ourselves with our hatreds. Ryan Bradley

    The Lounge question

  • Not Supported Exception
    R rbrad12345

    Hello everyone, I'm making a call to a native DLL on a PocketPC 2003 device via pinvoke. I have the call working fine in an eVB demo but it is returning a Not Supported Exception error when I call it in VB.NET. I'm trying to find some docs on how/why the Not Supported Exception error is thrown but can not find anything useful. Can anyone point me in the right direction? Thanks! Ryan Bradley

    Visual Basic csharp c++ help question

  • ATL COM wrapper: Link Error
    R rbrad12345

    Thanks for mentioning that. I think it is a piece of the puzzle. __cdecl decorates names while __stdcall does not. I've added #error directives to my header to ensure that __stdcall is used and it is. I've tried using __cdecl and it simply gives additional errors. My header prototypes "__declspec(dllimport) int __stdcall Read()" Despite all this sanity checking the linker is still looking for __imp__Read and not __imp_Read as it should. Ryan Bradley

    ATL / WTL / STL c++ help com question

  • ATL COM wrapper: Link Error
    R rbrad12345

    Now this is interesting... The symbols the linker errors out on are slightly different between the ATL/COM and the MFC app. The ATL/COM object is looking for __imp__Read while the MFC app is looking for __imp_Read. I can open up the .lib file in notepad and see __imp_Read. Any ideas?? X| :wtf: Ryan Bradley -- modified at 18:07 Friday 9th September, 2005

    ATL / WTL / STL c++ help com question

  • ATL COM wrapper: Link Error
    R rbrad12345

    The library was provided to me by a vendor. Using "dumpbin.exe /exports" I can see the calls I need to make. I'm using the same .H file to __declspec(dllimport) in my ATL/COM project as with the MFC project that works. That is what is confusing me. I'd guessed there is something different about how an ATL/COM project would attempt to link. This has to be something elementary that Im just missing. Ryan Bradley

    ATL / WTL / STL c++ help com question

  • ATL COM wrapper: Link Error
    R rbrad12345

    Hello everyone, Im new to the world of ATL and COM and am trying to create a wrapper class for a eVC++ library. I had the library working fine in a simple MFC app I wrote but the Linker fails in an ATL COM project I've created. Following is the error I receive. wrapper.obj : error LNK2019: unresolved external symbol __imp__Read referenced in function "public: virtual long __cdecl CReader::InitReader(void)" (?InitReader@CReader@@UAAJXZ) I'm guessing this error is due to a mis-understanding (on my part) of how ATL and COM link in external libraries. I was able to force the same error message in my MFC app by removing the .lib in "Project->Settings->Link:Object/Library Modules" which tells me that the Linker isnt seeing the library for some reason. Any help is much appreciated!! Thanks, Ryan Bradley

    ATL / WTL / STL c++ help com question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups