Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3433950
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:38:19+00:00 2026-05-18T07:38:19+00:00

I’m using Visual Studio 2010. I have a class with the following constructor: CVideoAnnotation::CVideoAnnotation(std::string

  • 0

I’m using Visual Studio 2010.

I have a class with the following constructor:

CVideoAnnotation::CVideoAnnotation(std::string aPort, DWORD aBaudRate)

I create an instance of CVideoAnnotation as follows:

CVideoAnnotation cVideoAnnotation("COM3", CBR_9600);

‘CBR_9600’ is a macro that resolves to 9600.

Down in the constructor, aBaudRate is 9600 as expected. However, aPort does not get passed properly. When I hover the cursor over it, IntelliSense gives a value of <Bad Ptr>.

Does anybody have any thoughts on why the string does not pass properly?

Thanks,
Dave

As an update to my original question, I’m adding the assembly code for the constructor call and the population of locals once inside the constructor.

   CVideoAnnotation cVideoAnnotation("COM3", CBR_9600);
0041177D  push        2580h  
00411782  sub         esp,20h  
00411785  mov         ecx,esp  
00411787  mov         dword ptr [ebp-174h],esp  
0041178D  push        offset string "COM3" (4198C8h)  
00411792  call        std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> > (41131Bh)  
00411797  mov         dword ptr [ebp-17Ch],eax  
0041179D  lea         ecx,[ebp-11h]  
004117A0  call        dword ptr [__imp_CVideoAnnotation::CVideoAnnotation (41D4DCh)]  
004117A6  mov         dword ptr [ebp-180h],eax  
004117AC  mov         dword ptr [ebp-4],0  





CVideoAnnotation::CVideoAnnotation(std::string aPort, DWORD aBaudRate)
{
100137F0  push        ebp  
100137F1  mov         ebp,esp  
100137F3  push        0FFFFFFFFh  
100137F5  push        offset __ehhandler$??0CVideoAnnotation@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@K@Z (1001DC82h)  
100137FA  mov         eax,dword ptr fs:[00000000h]  
10013800  push        eax  
10013801  sub         esp,164h  
10013807  push        ebx  
10013808  push        esi  
10013809  push        edi  
1001380A  push        ecx  
1001380B  lea         edi,[ebp-170h]  
10013811  mov         ecx,59h  
10013816  mov         eax,0CCCCCCCCh  
1001381B  rep stos    dword ptr es:[edi]  
1001381D  pop         ecx  
1001381E  mov         eax,dword ptr [___security_cookie (10026090h)]  
10013823  xor         eax,ebp  
10013825  mov         dword ptr [ebp-10h],eax  
10013828  push        eax  
10013829  lea         eax,[ebp-0Ch]  
1001382C  mov         dword ptr fs:[00000000h],eax  
10013832  mov         dword ptr [ebp-18h],ecx  
10013835  mov         dword ptr [ebp-84h],0  
1001383F  mov         dword ptr [ebp-4],0  
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T07:38:19+00:00Added an answer on May 18, 2026 at 7:38 am

    If you are implementing CVideoAnnotation in a separate DLL then you are having a well know issue of crossing DLL boundaries when using STL containers. To verify that this is the case create a new constructor taking a const char* instead of std::string and try..

    Another thing, instead of std::string prefer to use const std::string&

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
Does anyone know how can I replace this 2 symbol below from the string
I'm making a simple page using Google Maps API 3. My first. One marker
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a bunch of posts stored in text files formatted in yaml/textile (from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.