|
Hi,
Can any body help me to get all the directory listed in a combo box as windows explorer
thanks in advance
with regards
kashem
|
|
|
|
|
Just started build test apps with VC++.Net and I have a few silly questions?
(I have put this is the VC++ forum, sorry but not to sure about the differences and I hope I do not annoy anyone, just getting my feet on the ground! )
1. I need to write dynamic/data access web pages and I am not sure exactly what project type to use (so many!), I am currently building test apps in the 'Windows Forms Application .Net' project type, am I ok?
2. I would like to put a simple button on a web page (I have Dreamweaver etc) click it and my window pop up? not sure how I take the .exe file generated and actually get this to happen? think its something to do with XML and the XML file writing/reading classes?
3. Thanks a lot? I appreciate all help and value it!
Many thanks for your time and may the force be with you! (you'll need it!)
Many thanks for your time and may the force be with you! (you'll need it!)
|
|
|
|
|
Dam.NET wrote:
not to sure about the differences
Managed C++ means C++ that uses the .NET framework and compiles to the intermediate language used by all .NET languages. Your questions probably don't belong here.
Dam.NET wrote:
I am not sure exactly what project type to use (so many!),
Visual C# projects/ASP.NET web application. I'm not sure if you can do web pages in C++, but I see no reason why you'd want to.
Dam.NET wrote:
I would like to put a simple button on a web page (I have Dreamweaver etc) click it and my window pop up? not sure how I take the .exe file generated and actually get this to happen? think its something to do with XML and the XML file writing/reading classes?
No, you're completely lost here. If you set a button on a page in an ASP.NET project, you can create an event handler for the click, and have that redirect to another page. It sounds like you should read some ASP.NET articles on the site, maybe buy a book, and read some of the online help.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I have been trying to get the SSPI samples which I downloaded from an earlier CodeProject article:
http://www.codeproject.com/managedcpp/SSLClasses.asp[^]
As specified in the article I downloaded a test certificate from the Microsoft web site and got it installed in my machine. But my apps (Both Client and Server) fail in the AcquireCredentialsHandleA() call of the managed CPP assembly (SSL.lib) with error SEC_E_INTERNAL_ERROR.
As I am stuck at this stage, can someone point out what may be my mistakes. Will greatly appreciate any suggestions.
Thanks.
Senthil SS.
|
|
|
|
|
Hi,
After Importing a .wav in C++ .NET 2003, I'd like to be able to use code to load that .wav resource into a DirectSound secondary buffer, but am not sure how to do this, and cannot seem to find an example on MSDN, just a reference to it here: http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dx8_c/directx_cpp/audio_using_9oz3.asp">http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dx8_c/directx_cpp/audio_using_9oz3.asp[
|
|
|
|
|
Do anyone have UDF source code to read data from DVD-ROM
|
|
|
|
|
HI,
They say managed extensions C++ can be embed into an existing application which wrote in VC++ 6.0.
but I failed to do that follow the .NET document guide
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.2052/vcmex/html/vcconAddingMCToExistingApplication.htm
error message: error D2016 :“/RTC1” and “/clr” options is incompatible
|
|
|
|
|
Hi,
U Can Call Managed Class From MFC Application.U have To Change The Compiler Option As Follows
right click on the Solution Explorer ,click properties.
General - Use Managed Extensions = YES
C/C++ - General - Debug Information Format = Program Database (/Zi)
C++ - General - Compile As Managed = Assembly Support (/clr)
C/C++ - Code Generation - Enable Minimal Rebuild = No
C/C++ - Code Generation - Basic Runtime Checks = Default
and try to rebuild the Solution
by
baijumax;P
|
|
|
|
|
hello,
I need to pass an array to a dll that is written in vb6
The function looks like this in VB:
Private Function DrawVehicles(VehiclesToDraw As Variant, NumVehicle As Integer) As String
The program that uses the dll is in managed C++
I've used the tlbimp tool to create a com interop dll from the vb6 dll
tlbimp has translated the function to:
public string DrawVehicles(ref object VehiclesToDraw, ref short NumVehicle)
How do I have to fit an (variant) array into a System::Object?
greetings ,
Niko
|
|
|
|
|
Hi all,
I've created an ActiveX control using Visual C++ .NET.
When I add this control to a container created with Visual C++ .NET (or a Visual C++ 6.0) everything works and there is no apparently problem. But now, I'm trying to test this ActiveX with an application created with Visual Basic 6.0. The problem is that the ActiveX control does not appear in the list of registered components from the Visual Basic 6.0 (Menu -> Project -> Components, or Ctrl+T). So, I can't add my ActiveX to the Visual Basic 6.0 container.
When I try to make the same operation with a Visual Basic .NET container, I find the same situation, this is, the ActiveX control is not in the registered components list. But the ActiveX control is already registered.
I use the OleView application in order to ensure that the control is registered.
Due to my ActiveX control perfectly works with a Visual C++ .NET (and a Visual C++ 6.0) container, I suppose there is any bad chosen compiler option (by the time, everything is by default). Does anybody experimented the same situation testing his/her ActiveX in a Visual Basic container?
Thanks in advance.
|
|
|
|
|
Hai All,
In my application i want to set the lfHeight of the text using the LOGFONT structure. How can i use the LOGFONT structure and Font::FromLogFont in MC++? . I simply redefined the LOGFONT structure and uses it FromLogFont method. But runtime exception occures.
Anyone have any idea??
Thanks in Advance
Anish
|
|
|
|
|
The function takes a pointer to a System::Object.
You must cast the LOGFONT structure to a System::Object, using either __try_cast or reinterpret_cast.
The other overload also takes a pointer to the device context in addition to the Object pointer.
|
|
|
|
|
Hai,
I couldn't get it. Also runtime exception occures even i type caste the LOGFONT structure.
Can you show a simple piece of code using LOGFONT structure and Font::FromLogFont method
thank u
|
|
|
|
|
you needn't use FromLogFont, you can set it as this:
<br />
LOGFONT lf;<br />
CFont* pFont;<br />
memset(&lf, 0, sizeof(LOGFONT)); <br />
lf.lfHeight = 20; <br />
lf.lfWeight = 900;<br />
strcpy(lf.lfFaceName, _T("Tahoma"));<br />
pFont = CFont::FromHandle(::CreateFontIndirect(&lf));<br />
SetFont(pFont);<br />
were rgrtgrtvrtrt rtrtb brt tyuhjghj hbhbnh hnjm 1234567?
|
|
|
|
|
I came across this over at the MSDN site:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vcwlkPlatformInvokeTutorial.asp[^]
It's written for C# programmers, but, you use the same attribute in C++.
Also, if you just want to set only the Font height, and leave all the other LOGFONT structure members in their default settings (except for the Face Name), you can just use the appropriate Font constructor from the .NET Framework class library (without calling the FromLogfont method). This is the simplest approach. You instantiate with the new operator, the same way you do for all Form controls.
It occurred to me that the GDI LOGFONT structure is unmanaged code, and the Interop Marshaler makes the data conversions from managed to unmanaged and back again (if necessary). The problem with the LOGFONT struct, is that the original definition takes the lfFaceName mamber as an array of type TCHAR. Since this could be either ANSI or Unicode, the size of the array is not known at compile time. I assume the Interop Marshaler does not convert these values correctly (and, you'd think they'd note that in the documentation for the FromLogfont method). And, so you must specify this explicitly with the MarshalAs pseudo-custom attribute.
There are lengthy explanations of the inner workings of Interop marshaling in Adam Nathan's book, ".NET and COM: The Complete Interoperability Guide".
|
|
|
|
|
I am fairly new at programming; I am using Viusal Studio.net 2003.
Here is the problem I am trying to solve:
I have an MDI parent form which has a control. I also have a child form that needs to tell the control on the parent to do something.
I seem to be able to pass the control by reference to the child form class, and if I try to manipulate the control while still in the class constructor, everything works fine. However, when I try to access it elsewhere in the child form, i get an "undeclared identifier" error. Does anyone know how to fix it? Here is some code to show what I am doing:
THIS CODE IS IN THE PARENT FORM:
private: System::Void button2_Click(System::Object * sender, System::EventArgs * e)
{
FormChild2 *formChild2 = new FormChild2(myControl);
formChild2->MdiParent = this;
formChild2->Show();
}
THIS CODE IS IN THE FORMCHILD2 FORM:
public __gc class FormChild2 : public System::Windows::Forms::Form
{
public:
FormChild2(AxInterop::TWSLib::AxTws *myControl)
{
InitializeComponent();
myControl->connect("",7496,1);
}
};
SO while still in the class constructor I can use the "connect" property of the control, which I just passed by reference.
However, I want to be able to use that control after a button_click event while in the FormChild2 form. But that is when I get the "undeclared identifier" error.
Any suggestions would appreciated.
Thanks,
Jody Blau
|
|
|
|
|
Hai Jody,
the myControl in your child form is only the function scope. ie u can only use it in the Constructor because you paased it as an arguement. If you want to use the myControl in ChildForm, please declare a variable of AxTws in ChildForm and link it with Parent from
//Parent Form
private: System::Void button2_Click(System::Object * sender, System::EventArgs * e)
{
FormChild2 *formChild2 = new FormChild2(myControl);
formChild2->MdiParent = this;
fromChild2->myControl=this->myControl;
formChild2->Show();
}
//Child Form
public __gc class FormChild2 : public System::Windows::Forms::Form
{
public:
AxInterop::TWSLib::AxTws *myControl
FormChild2()
{
InitializeComponent();
myControl->connect("",7496,1);
}
};
Now you can use the myControl from anywhere in the ChildFrom
|
|
|
|
|
That worked great!!
I had no idea I could do it like that. That opens up all sorts of possiblities for me
Thank you very much for taking the time to help me out!
Jody Blau
|
|
|
|
|
We are currently working on a multi platform game and require programers please email staff@kingszone.com
|
|
|
|
|
If you can't afford to run ads, then how can you afford to pay programmers?
Also, how are you running a 'multi platform' game in Managed C++ ? If you're too stupid to even find a forum that suits your post, once again, why would anyone want to work for you ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Ouch!
some men see things as they are and say why, i dream of things that never were and say why not. - Unknown
|
|
|
|
|
I'm a novice programmer. I am using Visual Studio.net 2003.
I am wondering if there is a way to create an event that isn't bound to a GUI control.
For example: Is it possible to create an event that fires when something is added to a hashtable; OR an event that fires when a Global variable is incremented.
Any info, suggestions and especically simple code examples would be greatly appreciated.
thanks,
Jody Blau
|
|
|
|
|
You can create an event where-ever you like, so long as the object defines the event, or you're writing or wrapping the object in order to cause it to fire. For example, if you write a class that encapsulates a hash table, you can define an event that your class will fire, but I don't believe that hash tables define such an event.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
<br />
private: System::Void menuOpenFile_Click(System::Object * sender, System::EventArgs * e)<br />
{<br />
StreamReader* InputStream;<br />
OpenFileDialog* openFileDialog1 = new OpenFileDialog();<br />
<br />
openFileDialog1->InitialDirectory = S"c:\\" ;<br />
openFileDialog1->Filter = S"txt files (*.txt)|*.txt|All files (*.*)|*.*" ;<br />
openFileDialog1->FilterIndex = 2 ;<br />
openFileDialog1->RestoreDirectory = true ;<br />
<br />
if(openFileDialog1->ShowDialog() == DialogResult::OK)<br />
{<br />
if((InputStream = openFileDialog1->OpenFile())!= 0)<br />
{<br />
txtBoxSource->Clear();<br />
<br />
<br />
<br />
String* lineOfText = InputStream->ReadLine();<br />
<br />
while(lineOfText != NULL)<br />
{<br />
txtBoxSource->Text = <br />
String::Concat(txtBoxSource->Text, lineOfText, S"\r\n");<br />
<br />
lineOfText = InputStream->ReadLine();<br />
<br />
}<br />
<br />
<br />
InputStream->Close();<br />
}<br />
}<br />
}<br />
<br />
This program invoke a open file dialog. Now when I select a file
in the open file dialog, how do I read it? I used StreadReader,
but I got an error saying that it can't convert from System::IO.Stream
to System::IO.StreamReader.
I want to read the file and put it to the text box named txtBoxSource.
Thanks
-----------------------------
C++ without virtual functions is not OO. Programming with classes but without dynamic binding is called "object based", but not "object oriented".
|
|
|
|
|
Hai Alex,
you can solve the problem with this help of FileStram class
FileStream* fs;
StreamReader* InputStream;
OpenFileDialog* openFileDialog1 = new OpenFileDialog();
if(openFileDialog1->ShowDialog() == DialogResult::OK)
{
fs=new FileStream(openFileDialog->FileName,FileMode::Open);
InputStream=new StreamReder(fs);
//Then done your reading using InputStream
}
NB: please include using namespace System::IO;
|
|
|
|