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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. WinMain hidden powers

WinMain hidden powers

Scheduled Pinned Locked Moved C / C++ / MFC
questiondatabasecom
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Georg Haan
    wrote on last edited by
    #1

    Like most people here, I like small, compact and optimized code. Therefore I among other things, I ignore the default libraries when I can, and use a void main() instead of the default WinMain entrypoint. I was implemeting ADO as described here[^] in an app, which has such a void main() entry point. After successfully instantiating a ADODB.Connection object, I cannot use any of its functions normally. pConn->Open(...) causes an unknown exception, pConn->raw_Open(...) works fine. pConn->Execute(...) causes an unknown exception, pConn->raw_Execute(...) works fine. then after changing the void main to the standard WinMain, everything pConn 'behaves' normal. What is void main() lacking, what WinMain isn't? Georg Haan, NL

    M 1 Reply Last reply
    0
    • G Georg Haan

      Like most people here, I like small, compact and optimized code. Therefore I among other things, I ignore the default libraries when I can, and use a void main() instead of the default WinMain entrypoint. I was implemeting ADO as described here[^] in an app, which has such a void main() entry point. After successfully instantiating a ADODB.Connection object, I cannot use any of its functions normally. pConn->Open(...) causes an unknown exception, pConn->raw_Open(...) works fine. pConn->Execute(...) causes an unknown exception, pConn->raw_Execute(...) works fine. then after changing the void main to the standard WinMain, everything pConn 'behaves' normal. What is void main() lacking, what WinMain isn't? Georg Haan, NL

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      You're using the #import wrappers, right? Those use _bstr_t which is a MS-provided class that definitely needs the CRT. Not linking with the CRT is causing your troubles. --Mike-- Just released - RightClick-Encrypt v1.3 - Adds fast & easy file encryption to Explorer My really out-of-date homepage Sonork-100.19012 Acid_Helm

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

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