|
clarify please;)
cheers
MK
|
|
|
|
|
wow, i guess im confusing people. let me try again. i have a map with 'char' in them. and each map takes two elements, a key and a value. so i inserted in the map the 'char' as the key, and its predecessor as the value, for example:
key, value
e, d
d, c
c, b
b, a
a, a
i want to start from the 'char' e, and iterate through the map until i reach a, where the key and value are the same. how do i go about doing this, i am new to c++ and the template libray. thanks
|
|
|
|
|
i have written complete code for this program and it is running almost fine it is just not giving proper display in the last screen in the output.
please help me just reply me so that i will send you the source code files and if you want i can connect through netmeeting to show what is going wrong on the output screen. I am also available on msn as youngashish@hotmail.com
and at yahoo as young_ashish@yahoo.com
please please help me
just reply me so that i can send you the source code files.
|
|
|
|
|
No-one is going to help you, because you're going about it all wrong.
First of all, is your program managed C++ ? If not, you posted in a place that few people go, so no-one will see it.
Secondly, if you have a problem, you should post the code here and ask about it. You should certainly take hte time to know enough about what is going on to know where in your code it fails. Have you stepped through your code in a debugger ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
i will post the code can you help me i just wanna have the small bug being resolved.
please do reply me as soon as possible.
i will send you the code also
|
|
|
|
|
youngashish wrote:
i will send you the code also
Email me the code, and you will have to die.
Getting back to my original point though - is it in managed C++ ?
If you post it in the right forum, I'll be glad to help, and so will others, I am sure.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I can figure out how to do this with normal classes, but with managed forms, I am totally stumped. All I wanna do is communicate between forms. In this example, I wanna make the current form invisible, and make the other form visible, but after 2 weeks, still can't do it. I've had responses from people on it, but they only work for unmanaged classes, not these strange manged type things.
The problem is trying to get the second form to point to the first one when it hasn't yet been fully defined. Get errors such as
error C2512: 'datapassing::Form1' : no appropriate default constructor available
Please someone help me,
Using Microsoft Visual C++.NET V2003
I could manage forms untill .NET decided to manage them for me!!
**Form1.h**
<br />
#pragma once<br />
#include "Form2.h"<br />
<br />
namespace datapassing<br />
{<br />
<br />
public __gc class Form1 : public System::Windows::Forms::Form<br />
{ <br />
public:<br />
Form2 *pFrm2;<br />
public:<br />
Form1(void)<br />
{<br />
InitializeComponent();<br />
pFrm2 = new Form2;<br />
}<br />
<br />
private: System::Void button1_Click(System::Object * sender, System::EventArgs * e)<br />
{<br />
pFrm2->Visible = true;<br />
this->Visible = false;<br />
}<br />
};<br />
}<br />
**Form2.h**
<br />
#pragma once<br />
<br />
namespace datapassing<br />
{<br />
public __gc class Form1;<br />
public __gc class Form2 : public System::Windows::Forms::Form<br />
{<br />
public: <br />
Form1 *pFrm1;<br />
public: <br />
Form2(void)<br />
{<br />
InitializeComponent();<br />
pFrm1 = new Form1;<br />
}<br />
<br />
private: System::Void button1_Click(System::Object * sender, System::EventArgs * e)<br />
{<br />
pFrm1->Visible = true;<br />
this->Visible = false;<br />
<br />
}<br />
};<br />
}<br />
|
|
|
|
|
Hai
U can done it very simply. Don't include or declare Form1 in Form2 . It will produce circular referencing.
change ur code like this
**Form1.h**
#pragma once
#include "Form2.h"
namespace datapassing
{
public __gc class Form1 : public System::Windows::Forms::Form
{
public:
Form2 *pFrm2;
public:
Form1(void)
{
InitializeComponent();
pFrm2 = new Form2;
pFrm2->Owner=this;
}
private: System::Void button1_Click(System::Object * sender, System::EventArgs * e)
{
pFrm2->Visible = true;
this->Visible = false;
}
};
}
**Form2.h**
#pragma once
namespace datapassing
{
public __gc class Form2 : public System::Windows::Forms::Form
{
public:
public:
Form2(void)
{
InitializeComponent();
}
private: System::Void button1_Click(System::Object * sender, System::EventArgs * e)
{
this->Owner->Visible = true;
this->Visible = false;
}
};
}
By
Anish
|
|
|
|
|
This is fantastic, thanks, works just fine. One further thing though.
I have a text box textBox1 in form 1. I need to update it from form 2, I assumed that if I could make the form visible/invisible, I could also update the text box, so using your code I tried
this->Owner->textBox1->Text = "Updated Text";
This doesn't work, as the Owner only seems to be able to see the general form attributes, not the actual components of the form. How therefore do I change things such as text in the text box in form1, dependant upon an action in form2. If anyone can solve this problem for me (Been trying to figure it for 2 weeks now, but no-one is telling), I will consider you a god, and worship you daily.
Thanks
Ultimate Newbie
|
|
|
|
|
Hai,
i dont know the what i am saying is correct. but ur probelm can be solved in this way. But this is not recommended if u have heavy updation in ur Form1 class. One more reason for my qucik response is that next four days will not here.
simply pass a reference of ur textbox to the Form2 class
ie
Create a TExtbox object in ur Form2 class;
TextBox* t1;
Passes the reference of original one to this value in Constructor
frm2->t1=this->textBox1;
Now u can update the text in Button click as
this->tt->Text="Updated Text";
By
Anish
If u find a good solution plz post it here
|
|
|
|
|
I'm kind of new to CLI but does anyone know why this won't compile?
#include "stdafx.h"
using namespace System;
using namespace System::Data;
using namespace System::Data::SqlClient;
int _tmain()
{
SqlConnection ^myConn = gcnew SqlConnection("valid connection string");
myConn->Open();
if(myConn->State == ConnectionState::Open)
myConn->Close();
}
Its the default .NET console wizard in 2005 Express. I get errors a lot like this: error C3624: 'System::EnterpriseServices::ITransaction': the compiler cannot find this type;
it is defined in the assembly 'System.EnterpriseServices' (with various namespaces). Doesn't make any sense to me.
Matt Newman
...armed with what? spitballs!? - Zell Miller
|
|
|
|
|
|
Didn't know you had to add references like that, I guess C# does that automagically.
Matt Newman
...armed with what? spitballs!? - Zell Miller
|
|
|
|
|
I am using Visual Studio.Net 2003
My mainThread creates a newThread and the newThread starts doing its thing. At some point the newThread suspends itself; at which point it enters the ThreadState of Suspended.
I am trying to abort the newTread from my mainThread. When i attempt this using a newThread->abort();
It throws a ThreadStateException, i beleive because the newThread is suspended.
At this point the ThreadState of newThread is (SuspendRequested, AbortRequested).
So in the ThreadStateException catch, i use a newThread->Resume();
This causes the threadState of newThread to be simply (AbortRequested).
The problem is that I can't figure out how to get the newThread to leave AbortRequested state and enter the Stopped state.
If I call the abort from within newThread, it enters the Stopped state without problem; why can't I abort the newThread from within mainThread?
any help would be appreciated,
Thanks,
Jody Blau
|
|
|
|
|
You know how you can do the GetMessage() loop in Win32 programs? Is there any way to get the same thing in a c++ .NET app?
|
|
|
|
|
hey there,
Is there any way to create a simple client/server program in a 16 bit (dos)
project?
I can only use this kind of mode (dos 16 bit) because the microchip i am trying to control remotely connected to the server only supports borland 5.02 DOS 16 BIT projects.
thank you for helping and any suggestions are heart-warmingly welcome!
porac69
|
|
|
|
|
I have a dll written using VC++ 6. I cannot change it. But, I need to use it in C#. I am trying to write a wrapper in MC++ and then access it.
This is what I am trying.
In C#
------
static void Main()
{
try
{
F6xBscWrap f6bscW;
f6bscW = new F6xBscWrap();
//f6bscW.Reset();
}
catch(Exception e)
{
string s = e.StackTrace.ToString();
}
Application.Run(new Form1());
}
----
F6xBscWrap is the wrapper written in Managed C++. But as soon as the constructor is called it gives me a
An unhandled exception of type 'System.StackOverflowException' occurred in wrapf6com.dll
and crashes.
The managed wrapper for the constructor is
----
F6xBscWrap::F6xBscWrap()
{
try
{
f6bsc = new F6XBasicCfg();
}
catch(System::StackOverflowException *e)
{
Object *s = e->StackTrace;
}
}
----
and the wrapper .h file is
----
public __gc class F6xBscWrap
{
private:
F6XBasicCfg __nogc* f6bsc;
public:
F6xBscWrap();
~F6xBscWrap();
void Reset(); // Reset to zero
};
----
Any and all help will be appreciated.
|
|
|
|
|
I need to add hotkeys to buttons on a form
e.g F2-F12
How to do that?
tia,
kriss
Gupta Team Developer 3.1
VC++ 2003
Oracle 8i
W2K-XP
|
|
|
|
|
forget it, i put in a MainMenu and add the quickies there.
Where the menues are for buttons only, i simply hide them.
thanks, ;);P (( Kriss
Gupta Team Developer 3.1
VC++ 2003
Oracle 8i
W2K-XP
|
|
|
|
|
I am currently having trouble in writing a permutation in lex order the function i am working bellow is needing to do this:
//return position of the smallest number between index start+1
//and size (inclusive) that is greater than v[start]
It however i dont believe works correctly. Can any one help me.
v is a vector that contains: abcd
i = the first value to the L < R
size is the v.size()
//call of function
giveMePositiontoSwap(v, i, size);
//function
int giveMePositiontoSwap(vector<valuetype> &v, int start, int size)
{
int smValue = size-1;
for(int i=start+1; i < size-1; i++)
{
//finds a value greater than v[start]
if(v[i] > v[start])
{
//finds smallest value within the index start+1 and size
if(v[i] < v[smValue])
smValue = i;
}
sortItems(v, i+1, size);
}
return smValue;
|
|
|
|
|
I've been programming via V6 and MFC for a number
of years; but I'm a newbee with C++ .Net (2003).
I have been using STL's vector and map as my common
containers. Now am reading books on Managed C++ and
Forms. There I read of the Managed C++ .NET container
set.
My questions:
-- Are the Managed C++ .NET containers any more
(or less) efficient than SLT containers?
-- I understand STL containers. Is there any
advantage to move to Managed C++ .NET containers?
-- I would like a second opinion on strong advice
that I advance my knowledge of templates, read
"Modern C++ Design", plus several others recommended.
(I understand I have fallen behind in my knowledge
of the templates; but I'm not sure I really need to
keep up.)
WedgeSoft
|
|
|
|
|
They are less efficient and do not offer the functionality that STL gives you.
John
|
|
|
|
|
hi i am an engineering student and really interested in programming.. i want to develop a c or c++ program(not visual c++) . my iodea goes like this .. suppose somebody runs th .exe file . then suddenly a notepad opens and some text starts gettin written on it ........... similraly some sound also starts playin ...... i know how to open notepad or winamp but i really dont know how to play songs or write text through c......... if anybody could really help me then i will be really grateful..... this program is just for fun purpose............
|
|
|
|
|
So you don't want to use Visual C++, but you're posting in the Managed C++ forum ?
Your program sounds like a nuisance to me.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|