Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Thrift (Facebook API) newbie question

Posted on 2011-09-12
6
Medium Priority
?
1,325 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
Optimum High-Definition Video Viewing and Control

The ATEN VM0404HA 4x4 4K HDMI Matrix Switch supports 4K resolutions of UHD (3840 x 2160) and DCI (4096 x 2160) with refresh rates of 30 Hz (4:4:4) and 60 Hz (4:2:0). It is ideal for applications where the routing of 4K digital signals is required.

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Network ports are the threads that hold network communication together. They are an essential part of networking that can be easily ignore or misunderstood, my goals is to show those who don't have a strong network foundation how network ports opera…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

721 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