|
Hi all,
here is some interesting problem.... the problem setup goes like this...
a plane paper is placed on a table and a sphere is placed over it at some height and on that sphere at certain height a light was placed.
Noow as we all know it produces a shadow on the paper which will be some what elliptical if the light is not on the center line of the sphere. In this condition if we assume the paper as a 2D image then how can we calculate the pixels tht are covered under the elliptical shadow ( or to put it in other way while scannin form top how can we decide whether a pixel falls under the shadow).
any ideas ot thoughts are appreciated.
thanks in advance,
Suman
|
|
|
|
|
Google ray tracing.
Or DirectX will do it for you, if that's all you need.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
the shadow is the intersection of the plane of the paper and the cone whose apex is at the light and whose sides are tangent to the sphere.
The distance from apex (light) to center of sphere is the hypotenuse of a triangle whose side opposite the apex angle is the radius of the sphere. This is enough to determine the cone.
|
|
|
|
|
Hi Scott,
yep u r right....i understood ur point. But the problem is how to tell whether a pixel lies in the shadow or not. I mean r there any techniques or approach to find it out.
becos i was given a sphere of some radius and the height at which it is and the pixel at which the center of the sphere lies. and i have to figure out all the pixels covering under its shadow...and then i have to do some other calcualtins for those pixels... but first of all i have to find those pixels.
hope i am clear to u.
thanks in advance,
Suman
|
|
|
|
|
Dear sirs:
I am learning VC++ and am having trouble compiling my project. The project includes several classes that inherit properties from other classes. I ran into just 3 "unresolved external symbol errors - LNK2019".
I am using the Visual Studio .NET 2003 platform to develop the application with. I have included the source files with this post and you can recreate the project by creating a new Win32 Console Application project named "use_student", and simply add the files into your project.
Any help would be much appreciated!
Thank you,
Rob Hyland
NOTE: if you just see a line of code that says "#include" all by itself it should read
"#include (bracket symbol) iostream (bracket symbol)"
***************************************************************************************************
*********************************** Header Files **************************************************
//
//////////////////////////////////////////////////////////////
// Listing 13.3 studentc.h. /
// studentc.h -- defining a Student class using containment /
//////////////////////////////////////////////////////////////
//
//
#ifndef _STUDNTC_H_
#define _STUDNTC_H_
#include <iostream>
#include "arraydb.h" // -- ArrayDB objects.
#include "strng2.h" // -- String objects (from Chapter 11).
using namespace std;
class Student
{
private:
String name;
ArrayDb scores;
public:
Student() : name("Null Student"), scores() {} // -- Use initialization syntax to init. objects.
Student(const String & s) : name(s), scores() {}
Student(int n) : name("Nully"), scores(n) {}
Student(const String & s, int n) : name(s), scores(n) {}
Student(const String & s, const ArrayDb & a) : name(s), scores(a) {}
Student(const char * str, const double * pd, int n) : name(str), scores(pd, n) {}
~Student() {}
double & operator[](int i);
const double & operator[](int i) const;
double Average() const;
// friends
friend ostream & operator<<(ostream & os, const Student & stu);
friend istream & operator>>(istream & is, Student & stu);
};
#endif
//
/////////////////////////////////////////
// strng1.h -- string class definition /
/////////////////////////////////////////
//
//
#include <iostream>
using namespace std;
#ifndef _STRNG1_H_
#define _STRNG1_H_
class String
{
private:
char * str; // pointer to string
int len; // length of string
public:
String(const char * s); // constructor
String(); // default constructor
String(const String & st);
//~String(); // destructor
int length() const { return len; } // -- Return the length of a stored string.
// overloaded operators
String & operator=(const String & st); // Assignment operator
String & operator=(const char * s); // Assignment operator #2
// friend functions
friend bool operator>(const String &st1, const String &st2);
friend bool operator<(const String &st, const String &st2);
friend bool operator==(const String &st, const String &st2);
friend ostream & operator<<(ostream & os, const String & st);
friend istream & operator>>(istream & is, String & st);
};
#endif
//
/////////////////////////////
// Listing 13.1 arraydb.h. /
// arraydb.h -- array class /
/////////////////////////////
//
//
#ifndef _ARRAYDB_H_
#define _ARRAYDB_H_
#include <iostream>
using namespace std;
class ArrayDb
{
private:
unsigned int size; // -- Number of array elements.
double * arr; // -- Address of first element.
public:
ArrayDb(); // -- Default constructor.
// -- Explicit keyword used to catch assignment errors (i.e. incorrect number of arguments).
explicit ArrayDb(unsigned int n, double val = 0.0); // -- Create an ArrayDb of n elements, set each to val.
ArrayDb(const double * pn, unsigned int n); // -- Create an ArrayDb of n elements, initialize to array pn.
ArrayDb(const ArrayDb & a); // -- Copy constructor.
virtual ~ArrayDb(); // -- Destructor.
// -- Returns array size.
unsigned int ArSize() const
{
return size;
}
double Average() const; // -- Return array average.
//
//////////////////////////
// Overloaded operators. /
//////////////////////////
//
virtual double & operator[](int i); // -- Array indexing; allow modifications.
virtual const double & operator[](int i) const; // -- Array indexing; read-only.
ArrayDb & operator=(const ArrayDb & a); // -- Assignment.
friend ostream & operator<<(ostream & os, const ArrayDb & a);
};
#endif
***************************************************************************************************
************************************** Source Files ***********************************************
***************************************************************************************************
//
//////////////////////////////////////////////////////
// Listing 13.4 studentc.cpp. /
// studentc.cpp -- Student class using containment /
//////////////////////////////////////////////////////
//
//
#include "studentc.h"
double Student::Average() const
{
return scores.Average(); // use ArrayDb::Average()
}
double & Student::operator[](int i)
{
return scores[i]; // use ArrayDb::operator[]()
}
const double & Student::operator[](int i) const
{
return scores[i];
}
// friends
// use String and ArrayDb versions
ostream & operator<<(ostream & os, const Student & stu)
{
os << "Scores for " << stu.name << ":\n";
os << stu.scores;
return os;
}
// use String version
istream & operator>>(istream & is, Student & stu)
{
is >> stu.name;
return is;
}
//
///////////////////////////////////////////
// Listing 13.2 arraydb.cpp. /
// arraydb.cpp -- ArrayDb class methods /
///////////////////////////////////////////
//
//
#include <iostream>
#include "arraydb.h"
using namespace std;
#include (bracket symbol) cstdlib (bracket symbol) // exit() prototype
//
//
/////////////////////////////////////////
// Default constructor -- no arguments. /
/////////////////////////////////////////
//
//
ArrayDb::ArrayDb()
{
arr = NULL; // -- Empty.
size = 0; // -- No value.
}
//
//
/////////////////////////////////////////////////////
// Constructs array of n elements, each set to val. /
/////////////////////////////////////////////////////
//
//
ArrayDb::ArrayDb(unsigned int n, double val)
{
arr = new double[n]; // -- Create new array.
size = n; // -- Number of elements in array.
// -- Loop through array.
for (int i = 0; i < size; i++)
arr[i] = val; // -- Place variable in array.
}
//
//
////////////////////////////////////////////////////
// Initialize ArrayDb object to a non-class array. /
////////////////////////////////////////////////////
//
//
ArrayDb::ArrayDb(const double *pn, unsigned int n)
{
arr = new double[n]; // -- Create new array.
size = n; // -- Number of elements in array.
// -- Loop through array.
for (int i = 0; i < size; i++)
arr[i] = pn[i]; // -- Assign value from one array to another.
}
//
//
/////////////////////////////////////////////////////////
// Initialize ArrayDb object to another ArrayDb object. /
/////////////////////////////////////////////////////////
//
//
ArrayDb::ArrayDb(const ArrayDb & a)
{
size = a.size; // -- Size of array dictated by ArrayDb object.
arr = new double[size]; // -- Create new array.
// -- Loop through array.
for (int i = 0; i < size; i++)
arr[i] = a.arr[i]; // -- Assign value from object-array to array.
}
//
//
///////////////////
// Deconstructor. /
///////////////////
//
//
ArrayDb::~ArrayDb()
{
delete [] arr; // -- Free-up memory created with new.
}
//
//
////////////////////////////
// Take average of grades. /
////////////////////////////
//
//
double ArrayDb::Average() const
{
double sum = 0; // -- Initialize sum-of-grades variable.
int i; // -- Counter variable.
int lim = ArSize(); // -- Get array size.
// -- Loop through array.
for (i = 0; i < lim; i++)
sum += arr[i]; // -- Summation of grades.
// -- If counter is true, then take average.
if (i > 0)
return sum / i;
// -- Else there were no grades to average.
else
{
cerr << "No entries in score array\n";
return 0;
}
}
//
//
////////////////////////////////////////////////////////////
// Let user access elements by index (assignment allowed). /
////////////////////////////////////////////////////////////
//
//
double & ArrayDb::operator[](int i)
{
// -- Check index before continuing.
if (i < 0 || i >= size)
{
cerr << "Error in array limits: "
<< i << " is a bad index\n";
exit(1);
}
return arr[i]; // -- Return with array-value.
}
//
//
///////////////////////////////////////////////////////////////
// Let user access elements by index (assignment disallowed). /
///////////////////////////////////////////////////////////////
//
//
const double & ArrayDb::operator[](int i) const
{
// --Check index before continuing.
if (i < 0 || i >= size)
{
cerr << "Error in array limits: "
<< i << " is a bad index\n";
exit(1);
}
return arr[i]; // -- Return with array-value (read-only).
}
//
//
/////////////////////////////
// Define class assignment. /
/////////////////////////////
//
//
ArrayDb & ArrayDb::operator=(const ArrayDb & a)
{
// -- Check to see if the object is assigned to itself.
if (this == &a)
return *this; // -- If it is, don't change anything.
delete [] arr; // -- Free-up memory.
size = a.size; // -- Get new size from object.
arr = new double[size]; // -- Create new array.
// -- Loop through array.
for (int i = 0; i < size; i++)
arr[i] = a.arr[i]; // -- Assign value from object-array to array.
return *this;
}
//
//
//////////////////////////////////////
// Quick output, 5 values to a line. /
//////////////////////////////////////
//
//
ostream & operator<<(ostream & os, const ArrayDb & a)
{
int i;
for (i = 0; i < a.size; i++)
{
os << a.arr[i] << " ";
if (i % 5 == 4)
os << "\n";
}
if (i % 5 != 0)
os << "\n";
return os;
}
//
///////////////////////////////////////////////////////////////////////////
// use_student.cpp : Defines the entry point for the console application. /
///////////////////////////////////////////////////////////////////////////
//
//
#include <iostream>
#include "stdafx.h"
#include "studentc.h"
using namespace std;
//
//
/////////////////////////
// Function prototypes. /
/////////////////////////
//
//
void set(Student & sa, int n);
//
//
///////////////////////////
// Variable declarations. /
///////////////////////////
//
//
const int pupils = 3;
const int quizzes = 5;
//
//
///////////////////////////
// Start of main program. /
///////////////////////////
//
//
int _tmain(int argc, _TCHAR* argv[])
{
Student ada[pupils] = {quizzes, quizzes, quizzes}; // -- Create student object arrays.
int i;
for (i = 0; i < pupils; i++)
set(ada[i], quizzes);
for (i = 0; i < pupils; i++)
{
cout << "\n" << ada[i];
cout << "average: " << ada[i].Average() << "\n";
}
return 0;
}
//
//
/////////////////////////////////////////
// Function to register pupil's scores. /
/////////////////////////////////////////
//
//
void set(Student & sa, int n)
{
cout << "Please enter the student’s name: ";
cin >> sa;
cout << "Please enter " << n << " quiz scores:\n";
for (int i = 0; i < n; i++)
cin >> sa[i];
while (cin.get() != '\n')
continue;
}
***************************************************************************************************
****************************** End of Source Files ************************************************
***************************************************************************************************
|
|
|
|
|
Hi,
i wrote a program in vc++ and it generates some data values which i am writing it into a .txt file. Now for ploting a graph for tht data I am importing this file in excel and plotting the graph. But what i want is to open an excel sheet directly from my proram while executing and write the data whenever generated into it or to open an excel file at the end of program and import all the data in the txt file into it directly.
Plz remember I am not talkin about writing into an .xls file, but how to start the excel application and open a new file (anyway we will get a new blank sheet only when we start it)and then do all this stuff.
is it possible to implement this?.. if it is, is it very hard doin by writing handler programs or so...? and how can i start writing values into tht file from a specific starting point from which i am interested to write?
any suggestions or advices r appreciated.
thanks in advance,
Suman
|
|
|
|
|
You want to develop an application that will talk to MS Excel, correct?
Kuphryn
|
|
|
|
|
yep u got my point.....but how can we make it....
Suman
|
|
|
|
|
Yes that can be done by using OLE AUTOMATION. Just search on net for key word "Office Automation" VC++. You'll get lots of articles.
|
|
|
|
|
thanks Sujan..,
I will look over thru some of those articles and if I am not able to figure it out... then i will let u know...i hope u understood my problem clearly...
though i am able to open an excel sheet in my vc++ program... i must be able to write the values tht my program generates into it from whereever i want to in tht sheet (i.e in some way i must be able to switch between rows and columns of the excel sheet).
cheers,
Suman
|
|
|
|
|
Hi
the better way to start is to use the macro option in office products. Record a macro, open it in visual basic editor, convert it to a VC++ structure, and use it. But converting the visual basic code to VC++ code will take some time.
I haven't worked with excel, but with ms word and outlook.
Hope this helps you
Sujan
|
|
|
|
|
|
Hi Azam,
thanks for ur advice, I have gone through the link tht u have given and created an example project based upon those tutorial. Actually its an MFC application and it creates a dialog box on which we have to click on 'run' which then activates the excel.
but wht i am trying to do is .. my program is a pire c++ source file. it generates certain values in the time of its execution and at present i am writing them into an text file. But i want to open an excel sheet (just like i opened a text file) and then i have to write the values tht i generate..into the excel sheet (just like i write the values whenever generated into a text file). and then i have at the end of the execution i have show up the excel sheet.
one more thing is I'm willing to write the data in the sheet from a particular row and column. My data is a 2D data (256x256).
hope i am clear to u...if u r having any ideas lemme know i'll work on it.
thanks in advance,
Pavan.
Suman
|
|
|
|
|
ya i got it but wud you plz confirm me one thing, what kind of application you are developing, i mean is it a MFC based application (using CFile or some derivative of it for opening and writing text file) or a WIN32 application (using HFILE for opening and writing text file) or core C++ (using FILE structure for opening and writing text file).
As far as i know in either case you can use COM (or specifically Automation) for your application.
Also the link that i sent to you shows how you can write data in cells of excel sheet. were you able to run that program since if you are using excel 2002 or above then i suppose you have to change the line range.SetValue(COleVariant(saRet)); to range.SetValue2(COleVariant(saRet)); in your run method
any ways will try to figure out some thing for you
regards
Azam
|
|
|
|
|
Hi Azam,
I am writing just a common cpp source file and it is not any MFC or win32 application.I am using 'ofstream' to create text file and writing the values into it. My program goes like this....
#include <fstream.h>
#include <iostream.h>
#include <math.h>
#include <conio.h>
#define phi 3.1412
void main()
{.....
ofstream out_file("data.txt");
for(...)
{
for(...)
{.....
out_file<<",,,,";
}
}
....
}
yep i have ran tht tutorial program and it is indeed writing the values into excel..... but the only thing is completely dialog based and we have to enter values into the dialog box and then it writes it into excel sheet. But, here i have to write them directly into the excel sheet as and when i generate a value in my program..
hope i answered ur question in a right way...
thanks for ur help,
Suman
|
|
|
|
|
Hi Suman
Create a Win32 Console application project and paste the following code in the file containing main function donot forget to remove all things from that file b4 pasting
hope you will be able to customize this code according to your need what i suggest try to find the nested for loop that is writing in cells of excell file and in that nested for loop generate you data and assign it to the variable that is being written to the file;
One more suggestion try to encapsulate this procedureal code into some class for elegent look. and expose method like FIllCell(row,col,data) ..any ways its upto you further investigation of this code will also enable you to save the excel file on disk;
#include "stdafx.h"
#include <ole2.h>
// AutoWrap() - Automation helper function...
HRESULT AutoWrap(int autoType, VARIANT *pvResult, IDispatch *pDisp, LPOLESTR ptName, int cArgs...) {
va_list marker;
va_start(marker, cArgs);
if(!pDisp) {
MessageBox(NULL, "NULL IDispatch passed to AutoWrap()", "Error", 0x10010);
_exit(0);
}
DISPPARAMS dp = { NULL, NULL, 0, 0 };
DISPID dispidNamed = DISPID_PROPERTYPUT;
DISPID dispID;
HRESULT hr;
char buf[200];
char szName[200];
WideCharToMultiByte(CP_ACP, 0, ptName, -1, szName, 256, NULL, NULL);
hr = pDisp->GetIDsOfNames(IID_NULL, &ptName, 1, LOCALE_USER_DEFAULT, &dispID);
if(FAILED(hr)) {
sprintf(buf, "IDispatch::GetIDsOfNames(\"%s\") failed w/err 0x%08lx", szName, hr);
MessageBox(NULL, buf, "AutoWrap()", 0x10010);
_exit(0);
return hr;
}
VARIANT *pArgs = new VARIANT[cArgs+1];
for(int i=0; i<cArgs; i++) {
pArgs[i] = va_arg(marker, VARIANT);
}
dp.cArgs = cArgs;
dp.rgvarg = pArgs;
if(autoType & DISPATCH_PROPERTYPUT) {
dp.cNamedArgs = 1;
dp.rgdispidNamedArgs = &dispidNamed;
}
hr = pDisp->Invoke(dispID, IID_NULL, LOCALE_SYSTEM_DEFAULT, autoType, &dp, pvResult, NULL, NULL);
if(FAILED(hr)) {
sprintf(buf, "IDispatch::Invoke(\"%s\"=%08lx) failed w/err 0x%08lx", szName, dispID, hr);
MessageBox(NULL, buf, "AutoWrap()", 0x10010);
_exit(0);
return hr;
}
va_end(marker);
delete [] pArgs;
return hr;
}
int main(int argc, char* argv[])
{
CoInitialize(NULL);
CLSID clsid;
HRESULT hr = CLSIDFromProgID(L"Excel.Application", &clsid);
if(FAILED(hr)) {
::MessageBox(NULL, "CLSIDFromProgID() failed", "Error", 0x10010);
return -1;
}
IDispatch *pXlApp;
hr = CoCreateInstance(clsid, NULL, CLSCTX_LOCAL_SERVER, IID_IDispatch, (void **)&pXlApp);
if(FAILED(hr)) {
::MessageBox(NULL, "Excel not registered properly", "Error", 0x10010);
return -2;
}
{
VARIANT x;
x.vt = VT_I4;
x.lVal = 1;
AutoWrap(DISPATCH_PROPERTYPUT, NULL, pXlApp, L"Visible", 1, x);
}
IDispatch *pXlBooks;
{
VARIANT result;
VariantInit(&result);
AutoWrap(DISPATCH_PROPERTYGET, &result, pXlApp, L"Workbooks", 0);
pXlBooks = result.pdispVal;
}
IDispatch *pXlBook;
{
VARIANT result;
VariantInit(&result);
AutoWrap(DISPATCH_PROPERTYGET, &result, pXlBooks, L"Add", 0);
pXlBook = result.pdispVal;
}
VARIANT arr;
arr.vt = VT_ARRAY | VT_VARIANT;
{
SAFEARRAYBOUND sab[2];
sab[0].lLbound = 1; sab[0].cElements = 15;
sab[1].lLbound = 1; sab[1].cElements = 15;
arr.parray = SafeArrayCreate(VT_VARIANT, 2, sab);
}
for(int i=1; i<=15; i++) {
for(int j=1; j<=15; j++) {
VARIANT tmp;
tmp.vt = VT_I4;
tmp.lVal = i*j;
long indices[] = {i,j};
SafeArrayPutElement(arr.parray, indices, (void *)&tmp);
}
}
IDispatch *pXlSheet;
{
VARIANT result;
VariantInit(&result);
AutoWrap(DISPATCH_PROPERTYGET, &result, pXlApp, L"ActiveSheet", 0);
pXlSheet = result.pdispVal;
}
IDispatch *pXlRange;
{
VARIANT parm;
parm.vt = VT_BSTR;
parm.bstrVal = ::SysAllocString(L"A1:O15");
VARIANT result;
VariantInit(&result);
AutoWrap(DISPATCH_PROPERTYGET, &result, pXlSheet, L"Range", 1, parm);
VariantClear(&parm);
pXlRange = result.pdispVal;
}
AutoWrap(DISPATCH_PROPERTYPUT, NULL, pXlRange, L"Value", 1, arr);
::MessageBox(NULL, "All done.", "Notice", 0x10000);
{
VARIANT x;
x.vt = VT_I4;
x.lVal = 1;
AutoWrap(DISPATCH_PROPERTYPUT, NULL, pXlBook, L"Saved", 1, x);
}
AutoWrap(DISPATCH_METHOD, NULL, pXlApp, L"Quit", 0);
pXlRange->Release();
pXlSheet->Release();
pXlBook->Release();
pXlBooks->Release();
pXlApp->Release();
VariantClear(&arr);
CoUninitialize();
return 0;
}
hope this time i am on right direction
regards
Azam
|
|
|
|
|
oh there was a typo mistake
in HRESULT AutoWrap(int autoType, VARIANT *pvResult, IDispatch *pDisp, LPOLESTR ptName, int cArgs...)
// Extract arguments...
for(int i=0; i pArgs[i] = va_arg(marker, VARIANT);
}
replace these lines with these
for(int i=0; i < cArgs; i++) {
pArgs[i] = va_arg(marker, VARIANT);
}
|
|
|
|
|
Hi Azam,
thank you very much... it seems u have spent some of ur valuable time for my program.... at sometime today, i will try to include it in my program and make necessary changes and let you know the consequences.
once again thanking you,
Pavan.
Suman
|
|
|
|
|
Hi Azam,
thanks for ur concern and I am not able to understand ur code and include it into my program. Actually I have tried it doin till today and as I am feeling some guilty to tell you that I am unable to understand it. The actual thing is it was a long time for me doin programming (my undergrad is CSE) and at present i am in Biomedical Engineering doing a project on programming related BME project.
Actually instead of doin all these, if u don't mind i got an idea... why can't we draw a graph (3D graph) in c++ only with tht data. i did some 2D graphs, but no idea on 3D graphs, if I am goin in right direction, can u gimme any suggestions on this.
thanks for ur help,
Suman
|
|
|
|
|
Hi Suman
i really appreciate your effort, beleive me there is nothing to feel guilty about if you are unable to understand some code (it also happens to me as well, so no prob ). Atleast you haven't given it up and this should be the spirit, since not failure but low AIM is a crime.
any ways in C++, there are a number of graphics libraries that can be used to render 3D graphs. OpenGl (for example) is a very simple,powerful and easy to use 3d library and inparticular if you use one of its utility called "glut" then just with few lines of code you can draw 3D object in you program. (ya in console program as well )
so if you need any paarticular help about it then i can also do something in it for you since i worked on OpenGL in 2001 ( ya long ago).
wish you best of luck in your BME project
regards
Azam
|
|
|
|
|
Hi Azam,
thanks for ur inspiration. Anyway i am not an easy goin one, so i always feel guilty if i am not getting something which I have to.
I have seen some articles on OpenGL for 3D plots and I am goin thru them and let u know if i need any help in tht.
Meanwhile if u can i am having another task to complete, i.e changing my medical images into BMP format so that I can read them directly. My image files are in *.LL1 and *.LT1 formats. I am having their header info, but i haven't done regarding to header of images reviously, nor i did any format manipulations of images. The interesting thing is i have approached someone at fCoder group of developers, and they r able to convert, but for the source code or exe file they want me to pay $1000... . I have asked them to gimme some step by step procedure how to convert it. I hope they are even not willin to tell tht.
anyway thanks for ur time,
Suman
|
|
|
|
|
Hi Azam,
sorry to bother u again. Here is an article from our code project tht seems interesting to me on 3D plots.
http://www.thecodeproject.com/opengl/ntgraph3d_atl.asp
i am surprised whether it is so easy to implement it. But u know mine is a normal c++ source file, but he says tht inorder to use it we have to have an ActiveX control and then he has given the c++ snippet. Can u tell me how can i change my program to ActiveX control and embed this code into mine. Also i am generating my data in a for loop and i am having x,y,z values (one z value for each iteration) and how can i plot with my values. I will mail him too. But if got some ideas lemme know.
thanks in advance,
Suman
|
|
|
|
|
Hi Suman
There is no need to convert your program into an ActiveX control to use this code. Basically the author has given An ActiveX control, that can be used in our applications, to do this first we have to register the control using following command regsvr32 "C:\NTGraph3D_bin\NTGraph3D.dll" then we can use it in our ( vb,vc) applications (as demostrated by author in NTGraph3D_demo project ).
As far as your senario is concerned you have a plain C++ application, you have two options,
1. either search web for "using activeX control in console based applications".
2. or since the author has given the source of this ActiveX control use the classes created by him in your code.
if you are determined to use this control then do tell me lets see if i can figure out further on the above mentioned options, or if you have some other idea then also share it with me.
ActiveX Controls basically expose some methods and properties that we use to communicate with the control.
regards
Azam
|
|
|
|
|
Hi Azam,
Thanks for ur reply. I finally decidedd to use this control given in our forum. But i am not getting how to use it in my application. Prefer not to say, the demo progams are all greek and latin for me (sorry as a programmer i shouldn't say tht, but actually i am not able to understand). If I can sit for 1 to 2 days on it, i hope i may understand. But, this week i am busy with my midterm exams in other courses and i have to complete this by this friday. So, if u don't mind can u help me out in using this control in my program.
I want just an ActiveX control window showin my 3DSurface plot on it (i mean i don't need all those extra controls tht he has implemented in his demos, just a window with my plot). I hope I am clear. Just tell me how I can use it in my program if I am having 3 coordinates (x,y,z).
sorry, If i am bothering you. But, its urgent for me and I am not having time to go thru those demos in detail.
once again thanks for ur concern,
Suman
|
|
|
|
|
Suman, the problem here is that ActiveX control requires a container to run ( and container should be a CWnd derived class ). I have got an idea, if you donot mind give, give me you code ( i will embed this control in it thruogh some way and will mail it back to you ).
my email address is
muhammadazam_cis08@hotmail.com
regards
Azam
|
|
|
|
|