473,396 Members | 2,109 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Need Help in VC++

I want to use API's in VC++ ...
Can anyone tell me how to include the files.....

I am not getting API headers in VC++
Jan 23 '07 #1
4 1543
LSB
8
I want to use API's in VC++ ...
Can anyone tell me how to include the files.....

I am not getting API headers in VC++
Can you please give us a simple sample of your attempt?
Like "Hello, world!"?
Along with error message(s) from compiler?
Jan 23 '07 #2
Can you please give us a simple sample of your attempt?
Like "Hello, world!"?
Along with error message(s) from compiler?
Source Code:
Expand|Select|Wrap|Line Numbers
  1. #include "appapi.h"        
  2.   /*commenting above header gives the compilation errors problem with header...  */
  3.  
  4. #include "iostream"
  5. using namespace System;
  6. class MyApp
  7. {
  8. AppAPI *App;
  9. public:
  10. MyApp();
  11. int StartScheduler();
  12. static const int StartFun(void *userdata);
  13. };
  14. int main()
  15. {
  16. if (AppAPI::Init()) exit(0);
  17. MyApp *app = new MyApp;
  18. return app->StartScheduler();
  19. }
  20. MyApp::MyApp()
  21. {
  22. App = AppAPI::Create();
  23. if (App == NULL) exit(1);
  24. }
  25. int MyApp::StartScheduler()
  26. {
  27. return AppAPI::Start(App, &MyApp::StartFun, this);
  28. }
  29. const int MyApp::StartFun(void *userdata)
  30. {
  31. MyApp *app = (MyApp *)userdata;
  32. .
  33. .
  34. .
  35. return 0;
  36. }
  37.  
Here is the Compilation result

------ Build started: Project: as, Configuration: Debug Win32 ------
Compiling...
as.cpp
.\as.cpp(6) : error C2143: syntax error : missing ';' before '*'
.\as.cpp(6) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
.\as.cpp(6) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
.\as.cpp(14) : error C2653: 'AppAPI' : is not a class or namespace name
.\as.cpp(14) : error C3861: 'Init': identifier not found
.\as.cpp(20) : error C2065: 'App' : undeclared identifier
.\as.cpp(20) : error C2653: 'AppAPI' : is not a class or namespace name
.\as.cpp(20) : error C3861: 'Create': identifier not found
.\as.cpp(25) : error C2653: 'AppAPI' : is not a class or namespace name
.\as.cpp(25) : error C3861: 'Start': identifier not found
.\as.cpp(30) : error C2143: syntax error : missing ';' before '.'
Build log was saved at "file://c:\Documents and Settings\jagmeet\My Documents\Visual Studio 2005\Projects\as\as\Debug\BuildLog.htm"
as - 11 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Jan 24 '07 #3
Banfa
9,065 Expert Mod 8TB
I think the errors and answer are rather dependent on the contents of appapi.h, perhaps you could post it.


The compilation errors are occuring because at the line in question

AppAPI *App;

the class AppAPI has not been defined yet.
Jan 24 '07 #4
Motoma
3,237 Expert 2GB
Are you using the correct namespace for the AppAPI class? Does the AppAPI class exists in the default or System namespace?
Jan 24 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Ariant | last post by:
Hi - I'm trying to query my database to find the min, max and average times (in seconds, or minutes, or something) between two timestamps. I've tried using: Select avg(timestamp1 -...
4
by: soni29 | last post by:
hi, i need some help with a query, also to find out if this is even possible with sql. currently i have a table with the following data: CustomerNumber CustomerBranch 123 NULL 123 1...
2
by: Anonymous | last post by:
I'm trying to port code from VC.net to VC.net 2003. Here's a typical piece of code that's often used: template<class T> class PseudoContainer { typedef T::iterator iterator; // this line will...
28
by: Jed | last post by:
Hello to all! I have a couple of projects I intend starting on, and was wondering if someone here could make a suggestion for a good compiler and development environment. My goals are as...
11
by: Tatu Portin | last post by:
Have this kind of struct: typedef struct { char **user_comments; /* ... */ } vorbis_comment; /* prototype */ char * read_vorbis_string ( FILE *sc);
4
by: Anthony Gallagher | last post by:
I have a bunch of libraries compiled using VC++ 6.0, and I am trying to recompile one of our projects using VC++ .NET. I get all kind of linker errors (specially in STL calls). How do I get rid of...
8
by: Sai Kit Tong | last post by:
In the article, the description for "Modiy DLL That Contains Consumers That Use Managed Code and DLL Exports or Managed Entry Points" suggests the creation of the class ManagedWrapper. If I...
5
by: ashish.sadanandan | last post by:
Hi, Can someone please tell me where I can find those two libraries for Visual C++ 2005 Express Edition compiler? Thanks in advance, Ashish.
0
by: rsadalarasu | last post by:
Hi Everybody, I m very new to Db2. I tried compiling a stored procedure in DB2 Development Center. Build failed with error message like nmake command is unavailable..(something like that). I...
7
by: Norman Diamond | last post by:
A project depends on VC runtime from Visual Studio 2005 SP1, and DotNet Framework 2. Options are set in the setup project properties, so if these two dependencies are not already installed then...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.