|
If you ever need to program in MC++, you must upgrade. The VS.NET 2002 is too buggy to use - you will have frustrated as many things do not work as expected.
Also, there are some startup wizards to quickly generate codes for you similar to C#. It comes with .NET 1.1, which you will have to work to get it to work with VS.NET 2002.
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
Hi Robert... We should make this information more clear. All our messaging always seems to get lost... There are a significant number of changes in the C++ compiler from 7.1 to 7.0. There are things like P4/Athlon optimizations, SSE/SSE2 extension support, better whole program optimization (link-time optimizations), a better /GS switch and far, far, far better C++ conformance. If your a huge user of templates and use features like partial specialization and partial ordering, CL 7.1 is a huge win.
There are some benefits to the IDE also
Please checkout
http://msdn.microsoft.com/vstudio/
The upgrade is 29$ and you get a free pocketpc while supplies last
Albert Ho
.NET Developer Evangelist
Microsoft - Norcal
|
|
|
|
|
I'm writing data to a file and then wanting to run notepad.exe to display the data to the user.(Saves creating my own display medium) I've done it before in a Borland using SHELLEXECUTEINFO, and have been trying _exec** in VC++.Net without success.
Can someone point me in the right direction to what I should be using in the .Net environment please. i.e. what keywords should I be searching on.
Your help appreciated!
Regards,
Chris
|
|
|
|
|
WinExec ("notepad.exe",1);
rgds,
jhaga
|
|
|
|
|
Thanks for your help.
I tried it in my app, but it wouldn't compile, 'error C2065: 'WinExec' : Undeclared identifier.
I couldn't find it in my help either, so searching the MS website for WinExec led me to the following:
"The WinExec function runs the specified application.
Note This function is provided only for compatibility with 16-bit Windows. Applications should use the CreateProcess function.
"
so I'll give the CreateProcess function a try.
|
|
|
|
|
You need to include this file
#include "windows.h"
jhaga
|
|
|
|
|
That will work but since he said MC++ app, I am assuming he wants to use MC++ to do it (i.e. managed code). The way to do this in managed code is to use the BCL class System::Diagnostics::Process class like this:
#using <mscorlib.dll>
#using <System.dll>
using namespace System;
using namespace System::Diagnostics;
int _tmain()
{
Process::Start("Notepad.exe");
return 0;
}
------------------------------
Sam Gentile
Microsoft .NET Consultant
•Web Site : http://www.samgentile.com/
•My O'Reilly Articles: http://www.oreillynet.com/pub/au/1070
• Read my .NET Web Blog! http://dotnetweblogs.com/sgentile/
• Come hear me speak at Win-Dev! http://butrain.bu.edu/windev/bios.asp
----------------------------
|
|
|
|
|
I am losing some of the code with HTML formatting:
#using <mscorlib.dll>
#using <System.dll>
using namespace System;
using namespace System::Diagnostics;
int _tmain()
{
Process::Start("Notepad.exe");
return 0;
}
------------------------------
Sam Gentile
Microsoft .NET Consultant
•Web Site : http://www.samgentile.com/
•My O'Reilly Articles: http://www.oreillynet.com/pub/au/1070
• Read my .NET Web Blog! http://dotnetweblogs.com/sgentile/
• Come hear me speak at Win-Dev! http://butrain.bu.edu/windev/bios.asp
----------------------------
|
|
|
|
|
Hi All, wondering if someone could take a look at the below function and give me any clues as to why the output shows nothing.
I've passed through a sentence (no more than 100 characters) called sentence, which was input by the user. I'm trying to take each word, alphabetize it, and display the number of characters for each.
Thanks for any help!
<br />
void countOfChars(char sentence[]) <br />
{<br />
char *words = strtok(sentence," ");<br />
char *alphaArray[maxWords], *swap;<br />
int wordCount=0;<br />
<br />
cout << "\n\nWORD\t\t" << "Characters" << endl;<br />
<br />
while (words!=NULL) {<br />
wordCount++;<br />
words = strtok(NULL, " ");<br />
}<br />
alphaArray[wordCount] = words;
for (int i=0; i<wordCount-1; i++) {<br />
for (int j=0; j<wordCount-1; j++) {<br />
if (alphaArray[i] > alphaArray[i+1])<br />
swap = alphaArray[i+1];
alphaArray[i+1]=alphaArray[i];<br />
alphaArray[i]=swap;<br />
}}<br />
for (int x=0; x<wordCount; x++) { <br />
cout << alphaArray[x] << "\t\t" << strlen(alphaArray[x]) << endl;<br />
words = strtok(NULL, " ");<br />
}<br />
cout << endl;<br />
}<br />
Sheshi
|
|
|
|
|
// bubbelsort.cpp : Test use only
// Warning. Pointer handling, memory allocation and strtok() are bad
#include "string.h"
#include <iostream.h>
void countOfChars(char sentence[]) ;
int main(int argc, char* argv[])
{
const int buf_size = 1000;
char sName[buf_size]="a one a two";
//cout << "\n Enter max 50 words <each max 20 chars>:" << endl;
//cin.getline(sName, buf_size); // get the input line
countOfChars(sName);
}
void countOfChars(char sentence[])
{
char *words = strtok(sentence," ");
char *alphaArray[101]; // max 100 words
char *swap=NULL;
int wordCount=0;
while (words!=NULL) { // fill array
alphaArray[wordCount]=words;
wordCount++;
words = strtok(NULL, " ");
}
for (int i=0; i<wordCount; i++) { // bubbelsort the pointers
for (int j=i+1; j<wordCount; j++) {
if (*alphaArray[i]>*alphaArray[j])
{
swap=alphaArray[i];
alphaArray[i] = alphaArray[j];
alphaArray[j]=swap;
}
}
}
cout << "\n\nWORD\t\t" << "Characters" << endl; // display
for (int x=0; x <wordCount ; x++) {
cout << alphaArray[x] << "\t\t" << strlen(alphaArray[x]) << endl;
}
}
|
|
|
|
|
What is "this" pointer exactly?
Basil
|
|
|
|
|
a pointer to the class in context.
Hey leppie! Your "proof" seems brilliant and absurd at the same time. - Vikram Punathambekar 28 Apr '03
|
|
|
|
|
The this pointer is a pointer to the object its' self (that is secretly pass to a method/function).
Here are 2 examples that might help you understand:
Example using C:
//explicitly passing pointer to data object.
void func(struct structName* pData,int newID)
{
pData->ID = newID;
}
Example(s) using C++:
void func(int newID)
{
this->ID = newID;
}
OR
void func(int newID)
{
ID = newID; //"this->" is impiled if ID is member of class
}
Trust in the code Luke. Yea right!
|
|
|
|
|
Compiling i always receive the error message:
"DLLista::Component" no appropriate default constructor
what's wrong??
//DLLista.h
class DLLista : public Lista
{
public:
DLLista(Index n, BaseNode * V);
virtual ~DLLista();
class Component
{
public:
Component * next;
Component * prev;
BaseNode Element;
Component (BaseNode E);
};
};
//DLLista.cpp
DLLista::DLLista(Index n, BaseNode * V) : Lista(n, V){
};
DLLista::Component::Component(BaseNode E){
next=null;
prev=null;
Element=E;
};
DLLista::~DLLista(){};
//lista.h
class BaseNode
{
public:
BaseNode(){ indice = 0; };
private:
Index indice;
};
class Lista
{
public:
/* costruttore/distruttore */
Lista ( Index n, BaseNode * V );
~Lista();
}
|
|
|
|
|
Please avoid posting non-MC++ questions here. The code is full of arrangement problems. Also, there is nothing in "null" defined in C++. It should be "NULL"
Here is a simple rearranged codes which compiles successfully with VS.NET 2003, I am currently using:
typedef int Index;
class BaseNode
{
public:
BaseNode(){ indice = 0; };
private:
Index indice;
};
class Lista
{
public:
Lista ( Index n, BaseNode * V )
{
}
~Lista()
{
}
};
class DLLista : public Lista
{
public:
DLLista(Index n, BaseNode * V);
virtual ~DLLista();
class Component
{
public:
Component * next;
Component * prev;
BaseNode Element;
Component (BaseNode E);
};
};
DLLista::DLLista(Index n, BaseNode * V) : Lista(n, V){
};
DLLista::Component::Component(BaseNode E){
next=NULL;
prev=NULL;
Element=E;
};
DLLista::~DLLista(){};
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
Hello All,
Anyone got custom control toolbox icon/bitmap working and will like to share his/her experience. I need support not requiring direct loading from a file on a disk, but bitmap/icon in a resource.
It is very easy with VB.NET/C#
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
I'm not sure if this will workin MC++, but it should (i know its C#):
namespace nBASS {
[ToolboxBitmap(typeof(nBASS.BASS), "nBASS.BASS.bmp")]
public class BASS : Component
{
The bitmap is named BASS.bmp and is an embedded resource, added via solution tab. Note the default namespace gets added automatically.
HTH
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
Thanks.
I have being playing with something similar with success, may be I have to reexamine the implementation.
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
I didnt realise that adding managed resources was so difficult in a MC++ project. C# is such a breeze
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
Hi
Pretty self explanetory I have some C code compiled as unmanaged in the assembly, now all those methods show up as public and static global members. How can I make these private without wrapping them in a C++ (gc or nogc) class?
Thanks
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
There is no hidding process in the assembly. I do not know but try unmanaged #pragma
#pragma unmanaged
...
#pragma managed
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
Done that, didnt work For some reason my .h includes's from the CRT have disappeared, but all my own methods are there it would be possible for anyone to execute them via reflection.
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
I figured it out.
To make a wrapper of this C component (compilied in C) I went and changed all the settings, where all I had to do was a set my wrappers file to compile as /clr and C++. Beautiful The only methods shown are the C methods use by MC++. This way u dont have to mess with pragma blah/that .
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
i use the visual C++, and i want to someone tell me what is the best
Para seguir la trayectoria:
mira al maestro,
sigue al maestro,
camina junto con el maestro,
mira a través del maestro,
conviértete en el maestro
(this is a poor traduction)
To make you trayectory:
Look your master
Follow your master
walk whit your master
look across you master
become in your master
|
|
|
|
|
I am not sure what this has to do with "C and C++ compilers". I agree that [this is poor translation] (this is a poor traduction). I will ask Isrial, are main technition, if he is willing to help, since he is from a country near yours'.
I can not garantee he will be interested.
|
|
|
|