Solved

Thrift (Facebook API) newbie question

Posted on 2011-09-12
6
1,315 Views
Last Modified: 2012-05-12
Hi all,

I'm about to implement a TCP/IP communication infrastructure for communicating between C# & C++ applications on windows platform.
I considered implementing this from scratch, but then I stumbled upon Thrift (Facebook communication API), and from what I read it looks quite nice.
However, after downloading it and attempting to implement a basic sample, I feel a bit at loss...

Any help would be appreciated.
Thanks in advance.
0
Comment
Question by:AUROS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 

Accepted Solution

by:
AUROS earned 0 total points
ID: 36522787
Issue is no issue...
When creating thrift files using VS2010 the thrift compiler didn't like them, and generated empty output.
When creating the same files using VS2008 or notepad, all is good...
0
 
LVL 40

Expert Comment

by:evilrix
ID: 36525699
Not sure I follow you solution. The thrift compiler doesn't use Visual studio to generate the thrift bindings from its IDL.

Glad you got it working but just slightly concerned the solution you've accepted might be a little misleading.
0
 

Author Comment

by:AUROS
ID: 36525888
I was simply using VS to write the .thrift files.
Apparently, VS2010 saves the files as UTF8, which the compiler treats as empty files (with no errors). VS2008 saves the files as ASCII by default, which works fine for the Thrift compiler. So in VS2010 you simply have to "Save As" each thrift file, and change it's encoding - haven't found anything better (except for not using VS2010).
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 40

Expert Comment

by:evilrix
ID: 36526659
Ok, that makes a little more sense.

You should consider using Notepad++. I have a syntax highlighting file for thrift I can share with you if you do :)
0
 

Author Comment

by:AUROS
ID: 36527605
If you can send it, that would be great!
0
 
LVL 40

Expert Comment

by:evilrix
ID: 36528097
To use add the <UserLang> node to the <NotepadPlus> node of your C:\Users\[USERNAME]\AppData\Roaming\Notepad++\userDefineLang.xml file.

It's possibly a little out of date but it should cover most things and you can always add to it as you wish.
<NotepadPlus>
    <UserLang name="thrift" ext="thrift">
        <Settings>
            <Global caseIgnored="no" />
            <TreatAsSymbol comment="yes" commentLine="yes" />
            <Prefix words1="no" words2="no" words3="no" words4="no" />
        </Settings>
        <KeywordLists>
            <Keywords name="Delimiters">&quot;00&quot;00</Keywords>
            <Keywords name="Folder+"></Keywords>
            <Keywords name="Folder-"></Keywords>
            <Keywords name="Operators">( ) , : { } &lt; &gt;</Keywords>
            <Keywords name="Comment">1/* 2*/ 0// 0#</Keywords>
            <Keywords name="Words1">final namespace throws include required extend oneway</Keywords>
            <Keywords name="Words2">enum struct service exception</Keywords>
            <Keywords name="Words3">list i64 i32 i16 double string bool void map set binary</Keywords>
            <Keywords name="Words4"></Keywords>
        </KeywordLists>
        <Styles>
            <WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="FOLDEROPEN" styleID="12" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="KEYWORD1" styleID="5" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="KEYWORD2" styleID="6" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="1" />
            <WordsStyle name="KEYWORD3" styleID="7" fgColor="FF0000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="KEYWORD4" styleID="8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="COMMENT" styleID="1" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="COMMENT LINE" styleID="2" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="NUMBER" styleID="4" fgColor="804000" bgColor="FFFFFF" fontName="" fontStyle="1" />
            <WordsStyle name="OPERATOR" styleID="10" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="DELIMINER1" styleID="14" fgColor="FF0000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="DELIMINER2" styleID="15" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="DELIMINER3" styleID="16" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
        </Styles>
    </UserLang>
</NotepadPlus>

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
Suggested Courses

631 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question