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 6210273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:07:52+00:00 2026-05-24T06:07:52+00:00

I’ve been writing an application that monitors certain directory for files being added, and

  • 0

I’ve been writing an application that monitors certain directory for files being added, and sending those files in certain order. It does work perfectly. But I’ve encountered an interesting problem – I wrote this project on Windows XP, using VS 2008, and I need to merge my solution with another one, located on PC with Windows 7 and VS 2010, but the code I wrote just simply doesn’t work the same! A. k. a. I’ve treated TCHAR* as char*, as far as I know it shouldn’t give problems, but on VS 2010 the conversion doesn’t happen. The code is posted below.

int ftp_send(char* filename, TCHAR* path) {     
FILE *fPtr,*fp;     
char s[128],*loc=NULL;
char command1[1024];
char log[1024];
char systemcom[2048];
char name1[1024];
int success = 0;

sprintf_s(command1, 1024, "open 127.0.0.1\nbear\nitriv100\nbinary\nprompt\nmput %s\\rev%s*\n\nbye\n", path, filename);
sprintf_s(log, 1024, "%s\\log.txt", path);
sprintf_s(name1, 1024, "%s\\ftp.txt", path);
sprintf_s(systemcom, 2048, "ftp -s:%s -d | find\"226\"  >  %s", name1, log);
//printf("%s\n%s\n%s\n", systemcom, name1, log);
fopen_s(&fp, name1, "w+"); 
fprintf(fp,command1);

fclose(fp);

while(!success){
    system(systemcom);
    fopen_s(&fPtr, log, "r");
    if (!fPtr) {         
        printf("open file failure...\n");         
        return -1;     
    }          
    while (fgets(s, 128, fPtr) != NULL) { 
        loc = strstr(s, "226");
        if(loc != NULL) {     
            printf("File rev%s completely!!\n",filename);
            success = 1;
            return 0; 
        }
    }   
fclose(fPtr);
}
return -1;
}

Thanks in advance.

Constantine

  • 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-24T06:07:53+00:00Added an answer on May 24, 2026 at 6:07 am

    Most probably, the problem here is that your VS 2008 project was Multibyte CharacterSet based and VS 2010 project is UNICODE based.

    Right-click on Project->Properties->General->Character Set

    Change it to ‘Use Multi-Byte Character Set‘.

    Alternatively, if you want to keep your code UNICODE based, then add _T before all the strings that you are defining.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
Does anyone know how can I replace this 2 symbol below from the string
I need a function that will clean a strings' special characters. I do NOT

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.