Solved

Thrift (Facebook API) newbie question

Posted on 2011-09-12
6
1,299 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
  • 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now