|
Any Idea's Guys?
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
|
Hi, I am trying to make dynamic String array using vector. My code is
vector<String*> strArr;<br />
strArr.push_back(new String("string1"));<br />
strArr.push_back(new String("string2"));
this code gives me error in oush_back methode as below.
error C2440: '=' : cannot convert from 'System::String __gc *__gc * ' to 'System::String __gc ** '
Cannot convert a managed type to an unmanaged type
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\vector(579) : while compiling class-template member function 'void std::vector<_Ty>::push_back(System::String __gc *const __gc & )'
with
[
_Ty=System::String __gc *
]
eAssessment.cpp(20) : see reference to class template instantiation 'std::vector<_Ty>' being compiled
with
[
_Ty=System::String __gc *
]
Can I know what is wrong with this code?
|
|
|
|
|
priyank_ldce wrote: Can I know what is wrong with this code?
STL has no support for "managed" types. There is talk of an STL.NET.
Use a .NET container for the array.
led mike
|
|
|
|
|
Hi all
i am developing a console application in which i would like to read a unicode charecters from the keyboard. could any one tell me how to read unicode charecters from the key board?
i am using _gettchar() function. it is taking input charecters as mbcs and converting each into unicode, with which a charecter is becoming 4 bytes...
could anyone help on this??
devaravn
|
|
|
|
|
with .NET enabled:
Console::ReadKey - reads a single key
Console::ReadLine - reads a string
gettchar is not a .NET function.
_cgetws - reads a unicode string from
_getwch - reads a single unicode character
|
|
|
|
|
Hi! I made a program,that sends mail to a given e-mail address.But I also have to give the program the POP3 server. Is there any way to determine the POP3 address of the mail?How does,for example, MS Outlook work? How does it know to which POP3 server to send the e-mail?
|
|
|
|
|
elvman wrote: How does it know to which POP3 server to send the e-mail?
The "user" tells it by configuring Outlook settings.
led mike
|
|
|
|
|
And is there any "free" POP3 server,to which I can send e-mail,so that the server sends it to the target?
|
|
|
|
|
I don't know, but even if there is they won't let you use it to send spam.
led mike
|
|
|
|
|
But how does PHP mail function work?Where does it send messages?
|
|
|
|
|
Ok. I found out, that I have to send the e-mail directly to the recipients SMTP server.Searched all the internet,but didn't find any information.How to do that with sockets(i am using winsock)?If it's not possible with sockets than how is it possible?
|
|
|
|
|
Of course it is possible with sockets. If you are developing a C++/CLI project then use the .NET SMTP class, it would be much simpler.
System.Web.Mail
led mike
|
|
|
|
|
Ok.I made a program,which sends e-mail through SMTP server? But I have to create an SMTP server to send it (or use my ISP's SMTP server).I don't like it since my program will be used by other computers.But I heard, that it is possible to integrate an SMTP engine in a program.How can I make one? I searched the internet,but didn't find anything.
|
|
|
|
|
elvman wrote: Hi! I made a program,that sends mail to a given e-mail address.
If the user is "giving" the email address then they can "give" the SMTP address as well. I don't see a problem here.
led mike
|
|
|
|
|
Yeah, but users don't even know what's the IP. How the hell could they know whats an SMTP server? I need a tutorial on SMTP engines.Please help!
|
|
|
|
|
I have following piece of code, which works in VC7 but not in VC6. Don't know what's the problem.
A.h
----
class A
{
private:
template[int N] //using sqare brackets as somehow while posting it ignores '<'
class B {
public:
B() {}
class C
{
public:
C() {}
C* GetSomething() const;
}; //end class C
}; //end class B
};//end class A
A.cpp
------
template[int N]
typename A::B[N]::C*
A::B[N]::C::GetSomething() {}
RP
|
|
|
|
|
Repost the code and tick on the "Ignore HTML..." tick box so it renders properly and also post the error message(s) you are getting from the compiler/linker
Also, it might be better to post in the C++/MFC section as your problem is not C++/CLI related
|
|
|
|
|
I think what you are trying to do is not supported in VC++ 6.
George
-- modified at 20:12 Thursday 9th November, 2006
|
|
|
|
|
OK, before I get started I need to point out that I have never coded anything in Managed C++ before so what I am about to ask may seem as simple as drinking water to you, however to me it seems like moving mountains
I need to convert a comma delimited String* into a UNICODE PTCHAR array, so far my code looks something like the following:
<br />
Char splitChar[] = {','};<br />
String* split[] = searchReturnFields->Split(splitChar);<br />
<br />
char* returnFields[1024];<br />
for(int n=0; n<1024; n++)<br />
{<br />
returnFields[n] = NULL;<br />
}<br />
<br />
System::Collections::IEnumerator* myEnum = split->GetEnumerator();<br />
int enumPos = 0;<br />
while (myEnum->MoveNext())<br />
{<br />
String* field = __try_cast<String*>(myEnum->Current);<br />
returnFields[enumPos] = (char*)(void*)Marshal::StringToHGlobalAnsi(field);<br />
enumPos++;<br />
}<br />
Now assuming my input (searchReturnFields) is "val1,val2,val3" this code seems to partially work. I end up with an array that looks something like this:
<br />
[0] 0x0023a878 "x¨#" char*<br />
[1] 0x0023a858 "val2" char*<br />
[2] 0x0023a868 "val3" char*<br />
[3] 0x00000000 null<br />
[4] 0x00000000 null<br />
..<br />
..<br />
[1023] 0x00000000 null<br />
As you can see array position 0 contains, using the technical term, weirdy characters. However it should contain "val1".
So the question is what is going wrong here??
Also, why can I not do the following:
<br />
....<br />
String* split[] = searchReturnFields->Split(splitChar);<br />
<br />
char* returnFields[split->Length];<br />
....<br />
or
<br />
....<br />
String* split[] = searchReturnFields->Split(splitChar);<br />
int arrSize = split->Length;<br />
char* returnFields[arrSize];<br />
....<br />
From what I have managed to work out I have to give the array initialisation a constant int value
|
|
|
|
|
MrEyes wrote: I have never coded anything in Managed C++
MrEyes wrote: From what I have managed to work out I have to give the array initialisation a constant int value
So you are not experienced in C++? Why are you doing this project?
led mike
|
|
|
|
|
Thank for the information, hopefully with that I will find a working solution
|
|
|
|
|
MrEyes wrote: Thank for the information
Umm those were "questions" intended on understanding what level of help you require.
led mike
|
|
|
|
|
I have to work with xml files but i am new with that.
so i want to know how can i perform read and write operation with xml file.
if any body have idea about the same please share with me.
thanks & regards
bankey.
|
|
|
|
|
The XmlDocument class represents the DOM ( Document Object Model ), used to read, write and manipulate XML files. XPATH is the thing you need to google and learn about, if you want to search for nodes in your file.
|
|
|
|