|
use utilities for office. mso97.dll exports the required class to manipulate with office documents from your C++ application, get necessary classes from mso97.dll as a part of your application.
|
|
|
|
|
Just a tip.
If you create a text file, even a HTML page with colors and tables, and name it as .XLS, it will be read by Excel converting the HTML formatting to Excel as close as possible...I have got good results using this approach
GuimaSun
www.nexsun.com.br
NEXSUN TechZone
|
|
|
|
|
See if the MSDN article Q178749 is of any help.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi Shiva,
You have some options, but I would say the easiest is using Automation, but the drawback is Excel has to be installed on the client machine. The other option is using ADO and accessing Excel files as if they were databases, in this case Excel doesn't have to be installed, but you are limited on what you can do.
Anyways, to use Excel automation, check this article on the MSDN
Office Automation Using Visual C++
Fabian
|
|
|
|
|
Hi Friends,
I want to find out MAC address. I am using following method
GUID uuid;
CoCreateGuid(&uuid);
char mac_addr[18];
sprintf(mac_addr,"%02X:%02X:%02X:%02X:%02X:%02X",
uuid.Data4[2],uuid.Data4[3],uuid.Data4[4],
uuid.Data4[5],uuid.Data4[6],uuid.Data4[7]);
OutputDebugString(mac_addr);
But Every time it's giving the different address...
VikramS
|
|
|
|
|
First of all, you need to understand the difference between a MAC address and a GUID. If you really don't know the difference, may be this can help:
MAC Address: A 12-byte hexadecimal address used by the media access control layer of an 802.2 connection. It is an identifier of a network node that differentiates one node from another on a network.
GUID (Globally Unique Identifier): A 16-byte (128-bit) value that uniquely identifies some entity, such as a COM class, or COM interface. Examples of GUIDs are the CLSID and the IID. A GUID is also referred to as a Universally Unique Identifier (UUID).
To learn how to get the MAC address of an ethernet adapter, fire your MSDN and search for the keywords "MAC Address". Among your search resuls, you'll find an HOWTO article regarding your query. That is the solution to your problem.
Regards
Gurmeet BTW, can Google help me find my lost pyjamas?
My Articles: HTML Reader C++ Class Library, Numeric Edit Control
|
|
|
|
|
If your NIC is bound to NetBIOS, you can use this.
There's also the Win32_NetworkAdapterConfiguration WMI class.
GetAdaptersInfo() and GetIpNetTable() can also be used.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
template <class t="">
class Array
{
protected:
T* data;
unsigned int base;//the base of Array
unsigned int length;//the length of Array
public:
Array();
Array(unsigned int ,unsigned int=0);
Array(Array const&);//copy constructor
~Array();
void SetBase(unsigned int);//i myself can set base of array
void SetLength(unsigned int );
unsigned int GetBase() const;
unsigned int GetLength() const;
T const* Data()const;
};
|
|
|
|
|
|
hi Dominik and all,
I have downloaded the email sample from
http://www.naughter.com/smtp.html
i looks very nice, but i still can not make it work
error is "can not connect to server"
i use phone line home - what i need to fill in configuation dialog box?
thx
includeh10
|
|
|
|
|
The name of your SMTP server.
I'm a bit wary of aiding you, many uses of what you want to do are dubious and you haven't explained why you want this functionality.
Paul
|
|
|
|
|
we have many customers, we need to tell them same news every month, it wastes time.
this app will be a good help.
the process is: read email addresses from list then send news one by one.
name of SMTP server? why does the app always say "can not connect to"?
could u give me a sample string?
i use the string "203.161.1.284" - from gethostname(), is this right?
cheers
includeh10
|
|
|
|
|
I'd expect something like smtp.myisp.com. Your value isn't a valid IP address, FWIW. It'll be the same address that your current email client uses.
In SMTP you only need to make one connection, then you provide the list of addresses, then the message. It's worth reading the relevant RFCs (821/822 are the originals) then you'll have some understanding of the process. Creating a basic SMTP client isn't really very difficult, the complications arise when you start looking at authentication and MIME etc.
Paul
|
|
|
|
|
Paul,
thx for fast reply.
this is not my ip address because i don't know myself - except i copy from ipconfig.
i am testing this program now home, i use phone line to connect to the internet.
my current info is idxwc04-184.idx.com.au, could i change the string to name of SMTP server? or how can i get the name of SMTP server?
cheers
includeh10
|
|
|
|
|
There are two ways to send email from your machine to a@b.com.
1. Do a DNS query for the MX record for b.com. Connect to the SMTP server on that address. Send your email using SMTP.
2. Connect to your local SMTP server, usually supplied as part of your Internet package by your ISP. Send your email using SMTP. This server will relay it to the b.com server.
The former is not guaranteed to work because there is a growing trend to only accept email from a whitelist of IP addresses and your home machine is unlikely to be on the whitelist whereas your ISP's SMTP server is. This is the way that viruses and spammers tend to operate.
So you need to do the latter. You will know what your local SMTP server is because your ISP will have told you and that is how your (for example) Outlook Express connection will be set up.
If you have an Internet connection that doesn't provide Email, and so doesn't provide an SMTP server then I don't see how you can reasonably expect to proceed.
Paul
|
|
|
|
|
Paul,
by ur instructions, i sent an email to my ISP - use outlook - but i don't know if it is in SMTP format.
before i read papers, could u tell me how to send email uing SMTP?
if outlook is not using SMTP, what is it using? is there a c++ sample similar to outlook?
thx
includeh10
|
|
|
|
|
I can't tell you what Outlook is using, I expect it's SMTP.
Paul
|
|
|
|
|
how do you maximize a child window?? its probably on the oninitialupdate()...help
Actual Linux Penguins were harmed in the creation of this message.
|
|
|
|
|
Override PreCreateWindow() in your child frame class and make sure cs.style includes WS_MAXIMIZE .
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
That doesn't work.
Any other thoughts???
-B
|
|
|
|
|
stl list & iterators
I've got a list for XML objects. i'm using the std::list
i declare an iteraror, and set it to the beginning of the list
<br />
XML::iterator i = this->begin();<br />
then i want to go to the 'num' positon of the list, so i use this for bucle:
<br />
for(int ii=0; ii<num ;i++, ii++);<br />
that code is ok, i can see what's on the list.
The problem is that i don't know how to delete that position. the following code doesn't seem to work...
<br />
this->erase(i,i);<br />
do you have any ideas? this is my first project with stl.. i've read Eckels Thinking In C++ vol 2 and i can't find anything.. he speaks about a remove method, but i can't use it
thanks!!
|
|
|
|
|
Hi there,
In order to erase only one element, where the iterator is, use this sintax
iterator erase(iterator it);
Let me show you an example
list<int> myList;
list<int>::iterator it;
<br><br>
myList.push_back(1);
myList.push_back(2);
myList.push_back(3);
<br>
for(it = myList.begin(); it!=myList.end(); it++)
ATLTRACE(_T("%i\n"), *it);
<br>
it = myList.begin();
it++;
<br>
myList.erase(it);
<br>
for(it = myList.begin(); it!=myList.end(); it++)
ATLTRACE(_T("%i\n"), *it);
Try it, it should work.
Fabian
|
|
|
|
|
Hi,
Is there any way to change the location of source files for a project? I have all my sources in one directory and the project files in other directories. Now I would like VS to start looking in that source directory whenever I add a new or existing item.
Is that possible?
regards
Ludde
|
|
|
|
|
please help.... anyone? I have searched the docs in vain...
|
|
|
|
|
Hi!
Recently i downloaded an article from this page. This project was programmed in C++ with managed extensions and serves as a .NET Wrapper around a existing C++ implementation of random generators and distributions.
I added this project to my solution that consist of a C# windows application. Under VS.NET 2003 everything worked well and i could use the wrapped random generators and distributions.
Unfortunately, i had to move my solution back to VS.NET 2002. My C# windows application still works well, but the downloaded project doesn't get compiled. I receive the following errors, which i noted besides the lines that generate them:
<br />
template<class T><br />
struct ptr_helper<br />
{<br />
typedef T value_type;<br />
typedef T& reference_type;
typedef const T& rvalue_type;
static reference_type ref(T& r) { return r; }
static const T& ref(const T& r) { return r; }
};<br />
This struct is declared in a header-file of the existing C++ implementation that gets wrapped by the downloaded project.
Why can i compile this under VS.NET 2003 but not in VS.NET2002? What i can i do?
THX in advance
|
|
|
|