|
First you'll need to create a new class from the EXCEL9.OLB (or whatever version of Excel you are using) type library. That process will create a .CPP and .H file that gets added to your project.
|
|
|
|
|
And how to start this process? which tool generates this .cpp an .h files.
I'm using vc++ 6.0
|
|
|
|
|
Search MSDN for "excel.automation" and "excel9.olb".
|
|
|
|
|
ok thx,
i will first study a little bit.
I ask again when I knew it a bit better and can ask more special questions.
I thought it would be not as difficult because the odbc-connection was quite easy
|
|
|
|
|
Heiko2003 wrote:
I thought it would be not as difficult because the odbc-connection was quite easy
COM is much easier to do that what was previously required for OLE. With C++ it's even easier when you have smart-pointers and such at your disposal. With VB, it's way too easy! It almost takes the fun out of knowing what is actually going on behind the scene.
|
|
|
|
|
Now I've got a little application that is able to write an value into an excelcell.
Thanks for your information
|
|
|
|
|
Does anyone what are ways (code examples, etc) to make software evaluation based on "time expiration" and/or "number of runs"?
_ra
|
|
|
|
|
Do you have an idea how to do it ? i.e. in plain english (or whatever your mother tongue is ),
(for the expiration )
it's actually quite simple, when the program starts, you compare the current date with either the hard-coded expiration date (expires on june 3rd 2003), or the number of days left (expires in 34 days), if it expired, just warn and quit the program. The first time the program starts, you need to register the current date and keep it somewhere.
The only "hard" thing is to keep the "number of runs" or "expiration" somewhere on the user's computer that is not easy to find; you can hide it in the registry, or in a file somewhere on disk.
But eventually, people will find a way to overcome the limitation.
If you want to release an evalution version, you'd better make it a version with real limitation( no save, run time limit (runs for 30 mins), missing key features, ... )
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
Have a look at this[^]
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
Hi all,
I have thread A, which calls a function that takes a callback, and spawns thread B. My question is, when the callback is called in Thread B, does it remain in the context of thread B? I'm pretty sure it does, but I wanted to check.
Thanks!
|
|
|
|
|
Yup, as long as thread B is making the call.
|
|
|
|
|
Low priority.
In the top left of an SDI application, on the frame bar is the
little blue MFC icon. I have changed this icon in the resources, but it does not change on the frame bar.
Any suggestions?
thanks
|
|
|
|
|
did you change both the large and small resolutions in the icon resource?
-c
|
|
|
|
|
I missed one. thank you
|
|
|
|
|
Hi
Does anybody of you know a good regular expression library for C++ apart from regex++? I somehow don't like this template thingy
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
|
Thanks! I will try some of them
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi-
Did you try just using the RegEx class from boost ?
There are no templates to deal with and it performs like a champ.
Example without templates.
#include <cstdlib>
#include "boost/cregex.hpp"
#include <string>
#include <iostream>
using namespace std;
using namespace boost;
int main (int ac, char ** av)
{
RegEx rgx;
rgx = "pu.[a-f].c";
static char * matchStrings[] = {
"dpublic",
"pablic",
"private",
"chennai",
"whatsthis",
"pjslic",
"puslic",
"this string wont public",
NULL
};
for (char ** p = matchStrings; *p!=NULL; p++)
{
char * p2 = *p;
if(rgx.Match(p2))
{
printf("String %s \t*MATCH FOUND*\n",p2);
}
else
{
printf("String %s \tNo Match\n",p2);
}
}
return 0;
}
|
|
|
|
|
Yes I did. That's some code I'm using right now, and it preforms very well:
char *param_re = "^(.+)"(.+)"(2[0-5][0-5]|1[0-9][0-9]|[0-9]{1,2}),(2[0-5][0-5]|1[0-9][0-9]|[0-9]{1,2}),(2[0-5][0-5]|1[0-9][0-9]|[0-9]{1,2})"(2[0-5][0-5]|1[0-9][0-9]|[0-9]{1,2}),(2[0-5][0-5]|1[0-9][0-9]|[0-9]{1,2}),(2[0-5][0-5]|1[0-9][0-9]|[0-9]{1,2})"([0-9]+),([0-9]+),([0-9]+),([0-9]+)"([0-9]+),([0-9]+),([0-9]+),([0-9])+"([0-9]+),([0-9]+)("debug)?$";
regex expr(param_re);
cmatch matches;
if(!regex_match(data, matches, expr))
return;
But what I find somehow complicated is to assign the values inside the parentheses to chars:
std::string value;
value.assign(matches[i].first, matches[i].second);
Maybe that's just so strange to me, because I have nearly no knowledge of STL and string .
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Simple program embedded in an Active X Control. All Mouse Events get executed, but keyboard events are not getting called. Is there any configuration or directive I need to do to enable all the keyboard events to be called within my code?
Thanks in advance!!!
// Key.cpp : Implementation of CKey
#include "stdafx.h"
#include "KeyDemo.h"
#include "Key.h"
/////////////////////////////////////////////////////////////////////////////
// CKey
LRESULT CKey::OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) // Currently this method never gets called.
{
MessageBox("On Key Down");
return 0;
}
LRESULT CKey::OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
MessageBox("LButtonDown");
return 0;
}
Appreciate your help on this.
|
|
|
|
|
In addition to this I can only use Win32 API. MFC cannot be used.
|
|
|
|
|
Hello, C++ Newbie here. I have been trying to compile this program for two days and cannot seem to get it right.
I wrote a program that acts like a bank deposit. It will ask for the account number, annual rate, years of loan, and the principal balance. The program asks for all of this information, sends the variables to a function "compute", and then prints the annual interest earned back in main:
#define n 5
struct deposit {
char acnumber[10];
float* rate;
float* principal;
int* years;
float amount; };
float compute(float*,float*,int*);
void main() {
deposit d[n];
cout<<"Please enter the account information."<<endl;
for(int="" i="0;i<n;i++)" {
="" cout<<"enter="" the="" 9="" digit="" account="" number:="" ";
="" cin="">>d[i].acnumber;
cout<<"Enter number of years: ";
cin>>d[i].years;
cout<<"Enter the rate: ";
cin>>d[i].rate;
cout<<"Enter the principal amount: ";
cin>>d[i].principal;
}
compute((*d).rate,(*d).principal,(*d).years);
cout<<"The amount is: "<< d.amount <
|
|
|
|
|
webblynx wrote:
for(int i=0;i cout<<"Enter the 9 digit account number: ";
for(int i=0;i d[i].amount=(d[i].rate/100) * (d[i].principal) * (d[i].years);
What's up with these lines? Surely your compiler complained about them not being syntactically incorrect.
webblynx wrote:
compute((*d).rate,(*d).principal,(*d).years);
Instead of passing a mess of pointers to the compute() function, just pass the address of the local variable d, like:
compute(&d);
And change the function to be:
float compute(deposit *pDeposit)
|
|
|
|
|
DavidCrow wrote:
for(int i=0;i cout<<"Enter the 9 digit account number: ";
for(int i=0;i d[i].amount=(d[i].rate/100) * (d[i].principal) * (d[i].years);
I did this so that I could define the number of accounts to add at the beginning of the program. I tried to make a dynamic version of this but was unsucessful.
DavidCrow wrote:
compute(&d);
I changed the function call to this, but now I am getting:
"error C2664: 'compute' : cannot convert parameter 1 from 'struct deposit (*)[5]' to 'struct deposit' No constructor could take the source type, or constructor overload resolution was ambiguous"
C++ Newbian
|
|
|
|
|
Here's one possible solution:
struct deposit <br />
{<br />
char acnumber[10];<br />
double rate;<br />
double principal;<br />
int years;<br />
double amount; <br />
};<br />
<br />
double compute( deposit *pDeposit ) <br />
{<br />
pDeposit->amount = (pDeposit->rate / 100.0) * pDeposit->principal * (double) pDeposit->years;<br />
<br />
return pDeposit->amount;<br />
}<br />
<br />
void main() <br />
{<br />
deposit d[n];<br />
<br />
cout << "Please enter the account information." << endl;<br />
<br />
for (int i = 0;i < n; i++)<br />
{<br />
cout << "Enter the 9 digit account number: ";<br />
cin >> d[i].acnumber;<br />
<br />
cout << "Enter number of years: ";<br />
cin >> d[i].years;<br />
<br />
cout << "Enter the rate: ";<br />
cin >> d[i].rate;<br />
<br />
cout << "Enter the principal amount: ";<br />
cin >> d[i].principal;<br />
<br />
cout<<"The amount is: " << compute(d) << endl;<br />
}<br />
}
Here's another:
struct deposit <br />
{<br />
char acnumber[10];<br />
double rate;<br />
double principal;<br />
int years;<br />
double amount; <br />
};<br />
<br />
void compute( deposit *pDeposit ) <br />
{<br />
for (int i = 0;i < n; i++)<br />
pDeposit[i].amount = (pDeposit[i].rate / 100.0) * pDeposit[i].principal * (double) pDeposit[i].years;<br />
}<br />
<br />
void main() <br />
{<br />
deposit d[n];<br />
<br />
cout << "Please enter the account information." << endl;<br />
<br />
for (int i = 0;i < n; i++)<br />
{<br />
cout << "Enter the 9 digit account number: ";<br />
cin >> d[i].acnumber;<br />
<br />
cout << "Enter number of years: ";<br />
cin >> d[i].years;<br />
<br />
cout << "Enter the rate: ";<br />
cin >> d[i].rate;<br />
<br />
cout << "Enter the principal amount: ";<br />
cin >> d[i].principal;<br />
}<br />
<br />
compute(d);<br />
}
The [code][/code] tags kill the indentation. Sorry!
|
|
|
|