Need to transfer my output from log to target directory in VB C++

  • (2 Pages)
  • +
  • 1
  • 2

28 Replies - 2849 Views - Last Post: 17 July 2015 - 06:55 AM Rate Topic: -----

#1 Sahana_gowda   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 49
  • Joined: 22-June 15

Need to transfer my output from log to target directory in VB C++

Posted 14 July 2015 - 02:12 PM

Somebody please help me, I am getting output on edit control right now, I need to transfer output from my edit control to target directory. I have used a button on my template, in which when, I click the button it should save all my log files from the edit control as output file into my directory.


I have attached the screenshot ..Output comes on Sample edit box , ID of the control is IDC_LOG, when i click the button "Save all the output" it should save in the target directory.

Thank you,

Is This A Good Question/Topic? 0
  • +

Replies To: Need to transfer my output from log to target directory in VB C++

#2 Sahana_gowda   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 49
  • Joined: 22-June 15

Re: Need to transfer my output from log to target directory in VB C++

Posted 14 July 2015 - 02:17 PM

Screenshot:- Attached Image
Was This Post Helpful? 0
  • +
  • -

#3 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 6285
  • View blog
  • Posts: 21,609
  • Joined: 05-May 12

Re: Need to transfer my output from log to target directory in VB C++

Posted 14 July 2015 - 04:20 PM

What is "VB C++"?
Was This Post Helpful? 0
  • +
  • -

#4 Sahana_gowda   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 49
  • Joined: 22-June 15

Re: Need to transfer my output from log to target directory in VB C++

Posted 14 July 2015 - 06:02 PM

View PostSkydiver, on 14 July 2015 - 04:20 PM, said:

What is "VB C++"?


Visual Basic C++, In the title there was not enough space so, in short VB C++...
Was This Post Helpful? 0
  • +
  • -

#5 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 6285
  • View blog
  • Posts: 21,609
  • Joined: 05-May 12

Re: Need to transfer my output from log to target directory in VB C++

Posted 14 July 2015 - 06:28 PM

Perhaps you mean "Visual Studio C++"?
Was This Post Helpful? 1
  • +
  • -

#6 Sahana_gowda   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 49
  • Joined: 22-June 15

Re: Need to transfer my output from log to target directory in VB C++

Posted 14 July 2015 - 06:39 PM

View PostSkydiver, on 14 July 2015 - 06:28 PM, said:

Perhaps you mean "Visual Studio C++"?

yes
Was This Post Helpful? 0
  • +
  • -

#7 #define   User is offline

  • Duke of Err
  • member icon

Reputation: 1853
  • View blog
  • Posts: 6,671
  • Joined: 19-February 09

Re: Need to transfer my output from log to target directory in VB C++

Posted 14 July 2015 - 07:32 PM

Hi, can you create a member variable for it? Is it multiline?
Was This Post Helpful? 0
  • +
  • -

#8 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 6285
  • View blog
  • Posts: 21,609
  • Joined: 05-May 12

Re: Need to transfer my output from log to target directory in VB C++

Posted 14 July 2015 - 08:19 PM

It's easy. Use GetWindowText() to get all the textbox contents, and use WriteFile() to output the contents into a file.
Was This Post Helpful? 1
  • +
  • -

#9 Sahana_gowda   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 49
  • Joined: 22-June 15

Re: Need to transfer my output from log to target directory in VB C++

Posted 14 July 2015 - 09:37 PM

View PostSkydiver, on 14 July 2015 - 08:19 PM, said:

It's easy. Use GetWindowText() to get all the textbox contents, and use WriteFile() to output the contents into a file.


Thank you, I will try this.

View Post#define, on 14 July 2015 - 07:32 PM, said:

Hi, can you create a member variable for it? Is it multiline?


Yes it is multiline output.. member variable?
Was This Post Helpful? 0
  • +
  • -

#10 Sahana_gowda   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 49
  • Joined: 22-June 15

Re: Need to transfer my output from log to target directory in VB C++

Posted 15 July 2015 - 08:16 AM

View PostSkydiver, on 14 July 2015 - 08:19 PM, said:

It's easy. Use GetWindowText() to get all the textbox contents, and use WriteFile() to output the contents into a file.


I wrote like this :

string n= IDC_LOG.GetWindowTextLength(); // IDC_LOG is the edit control id

It gives error saying:

IntelliSense: expression must have class type.

Can you please me say me, what's the error here
Was This Post Helpful? 0
  • +
  • -

#11 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 6285
  • View blog
  • Posts: 21,609
  • Joined: 05-May 12

Re: Need to transfer my output from log to target directory in VB C++

Posted 15 July 2015 - 12:20 PM

Let me repeat from my previous post from your other thread:

View PostSkydiver, on 23 June 2015 - 05:59 PM, said:

As much magic that MFC has, it can't magically take an icon window ID and give it an -> operator override that exposes a Visible property.



In this case, instead of an "icon window ID", substitute "edit box window ID" and "->" with ".".

You need to get a windows handle and wrap it in a MFC window handle wrapper, or have a MFC Window control that refers to the window with that ID.
Was This Post Helpful? 1
  • +
  • -

#12 Sahana_gowda   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 49
  • Joined: 22-June 15

Re: Need to transfer my output from log to target directory in VB C++

Posted 15 July 2015 - 12:42 PM

Agreed... This is the window ID "IDD_VORTEXII_SAMPLE_DIALOG" am working on.. In this window, edit control ID is "IDC_LOG"

"You need to get a windows handle and wrap it in a MFC window handle wrapper" what is this handle wrapper mean?, Could you please write it in code, how it would go in syntax..

Thank you very much
Was This Post Helpful? 0
  • +
  • -

#13 Sahana_gowda   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 49
  • Joined: 22-June 15

Re: Need to transfer my output from log to target directory in VB C++

Posted 15 July 2015 - 12:54 PM

I tried like this:

int n=IDD_VORTEXII_SAMPLE_DIALOG.GetWindowTextLength(IDC_LOG);

???

I get errors like this :

Error 9 error C2228: left of '.GetWindowTextLengthW' must have class/struct/union

Error 10 IntelliSense: expression must have class type
Was This Post Helpful? 0
  • +
  • -

#14 #define   User is offline

  • Duke of Err
  • member icon

Reputation: 1853
  • View blog
  • Posts: 6,671
  • Joined: 19-February 09

Re: Need to transfer my output from log to target directory in VB C++

Posted 15 July 2015 - 02:48 PM

You could create a variable for the edit control in the wizard.
Was This Post Helpful? 0
  • +
  • -

#15 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 6285
  • View blog
  • Posts: 21,609
  • Joined: 05-May 12

Re: Need to transfer my output from log to target directory in VB C++

Posted 15 July 2015 - 06:05 PM

Or, if you already have a CDialog, you could always call GetDlgItem() like it shows in the documentation to get a CWnd. A CWnd is a window handle wrapper.

I am very very surprised that you are trying to use MFC without at least reading a tutorial or reading a book about MFC. It looks like you just started drag/dropping controls and cobbled things together based on things you've found on the Internet without taking time to understand what is happening.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2