|
After the edit control has been created, the ES_PASSWORD style can't be changed.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
i have an c++ application build with /clr option and have integrated crash reporting feature.
the crash dump it generates does not show line numbers when i debug the dump using windbg.
(i found that applications build with clr does not show line numbers)
it shows the function name where it crashed but not the exact line number. for eg
it shows:
03434456 02312434 CExApp::OnOpenFile() + 0x30c
Is there any way to calculate the line number by using the offset 0x30c ?
thanks
|
|
|
|
|
Luc Pattyn [My Articles] Nil Volentibus Arduum
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Please use <PRE> tags for code snippets, they improve readability. CP Vanity has been updated to V2.4
|
|
|
|
|
I am beginner in visual studio 2008 (C++/CLI) (Windows Form Application).
Can anyone help me Please..?
I want to know that how we can create multi-project solution in following way?
for example..
I have two projects "A" and "B".
can form of "B" called from "A"'s click event?
Thanks in advance.
|
|
|
|
|
If the two projects create executables, then you'll need some form of Interprocess Communication[^] for the two processes to communicate.
Or is one or more of the projects a library?
What are you trying to do?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks for your quick reply
I am studying the Interprocess Communication link that you suggested to me.
Neither the projects are any type of library
The scenario is as:
Our company have too many (more than 20 in numbers) products (Hardware units) needs separate UI to handle Inputs and Outputs.
1. It is difficult to handle different software application for each product.
2. If customer has more than one products of our company then he should be able to select dynamically which application will run.
so I am trying to integrate all the needed and related applications in one solution.
|
|
|
|
|
If you just have a main solution (creating an executable) and all you're trying to do is spawn other applications when a users selects something within the main app, then its easy, all you have to do is know how to start the secondary application.
|
|
|
|
|
If projects are managed DLL, then you could do anything you want. The only thing to be aware is that reference to others DLL are unidirectionnal.
Assuming that each project are independant of the other, you could then have:
- ProjectA.dll (managed DLL with forms for A)
- ProjectB.dll (managed DLL with forms for B)
- ProjectC.dll (managed DLL with forms for C)
- MainApplication.exe (main application with reference to other DLLs)
MainApplication will then be able to uses any public forms in other DLLs. It will be able to uses events generated by those forms.
You may also need to add an extra DLL that will be referenced by each project if you need some common functionality.
By the way, then main application I have developped has many C++/CLI and many C# DLL.
I prefer to uses C# for the UI as design-time support is far superior. The main problem with that is that when refactoring code, sometimes, I have to convert some C++/CLI code to C# and vice-versa. I was using .NET Reflector with C++/CLI plug-in but now the new version is a paid product and old plug-in does not seems to be supported.
Philippe Mori
|
|
|
|
|
I have prepeared project folllowing instrctions given in this article(Calling Managed .NET C# COM Objects from Unmanaged C++ Code).
I have used VS 2008 and .Net Framework 2.0 for both projects.
I am able to access ShowDialog() method as shown in this article but when i added another method to same interface it was not available in c++.
I checked both .tlb and .tlh file I can see both of them having declaration of new method added.
but I try to acces it through pDotNetCOMPtr-><new method="" not="" included="">
Please let me know what I am missing?
|
|
|
|
|
Did you rebuild the .NET project?
Also, it helps if you could show the code.
|
|
|
|
|
By the way, you might also consider making a mixed-mode C++ code. If you cannot put your original C++ code in that project without problems, you might then explore the possibility to create a mixed-mode layer.
In my case, my C++ code is compiled in mixed mode (/clr) so I can mix regular C++ with managed C++ in the same DLL. It might not always be feasible in existing code is large and uses incompatible options.
In that latter case, I might also try to have an extra DLL (mixed-mode C++) that would make the bridge between unmanaged C++ and managed code. Then existing C++ code would uses that DLL to indirectly call C# code.
This approch have some advantage like you could somehow adapt C++ code to be easier to uses or follows your C++ code convention or do some transformation between types like converting System::String^ to wstring for uses in C++.
I have never really tried the C# COM objects by their should be no problem with that method provided that all required symbols are public and GUID are assigned when required.
Philippe Mori
|
|
|
|
|
Hi all,
I wanna to connect postgresql, and I prefer to ODBC with MFC before.
However, I don't know how to do this by c++/cli, can any kind man give me some advice or some online ariticle about this?
Thanks in advance.
Joul
|
|
|
|
|
|
Hi,
I wanna to draw something in the panel which can be scrolled.
For example, I just want to draw a line in the panel, so I added the drawing codes in the on_paint event:
e->Graphics->DrawLine(bluePen, 0, 0, 100, 100);
And then it can be displayed correctly.
However, when I scrolled the vertical scroll bar, it can display ok, but sometimes display with remnant. I don't know whether it's a bug of the panel control.
So I tried to add "Invalidate" function to the panel scroll event, however, the panel can not display ok when scrolling.
Can any kind man give me some advice? Maybe it's a simple question.
Thanks.
Joul
|
|
|
|
|
hi, all.
I found the reason, just add AutoScrollPosition when drawing.
Joul
|
|
|
|
|
Hey Guys,
I've done some Googling and some MSDN searches, but no luck. What I have is two Windows forms. I want to be able to attach a file/files from one of the forms, and then have the other form be able to see/open these attachments. Any ideas on which controls, data structures, or methods to use? I'm a bit stumped right now. I've investigated the FileDialog class, but I don't think that's what I need.
[Insert Witty Sig Here]
|
|
|
|
|
1. The OpenFileDialog and SaveFileDialog let you interact with the user to determine which file he wants opened or saved, that is not what you want.
2. There is no universal control (or app) that can visualize any file you choose, unless in a very low-level form, such as a hex editor would do. So you will have to restrict the list of allowable file types, and/or use several controls, picking the one at run-time that corresponds to the current file type.
3. I have no idea what you mean by "attaching a file to a form".
Luc Pattyn [My Articles] Nil Volentibus Arduum
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Please use <PRE> tags for code snippets, they improve readability. CP Vanity has been updated to V2.3
|
|
|
|
|
Here is a scenario. Form1 is for the manager. From form1 he can enter a description of a project, assign a lead, and enter comments. With most projects, there are associated .doc, .pdf, or .xls files. By attach, I mean that the manager can add those files, similar to an email, so that the lead, from Form2 can see the files. I don't want the files to be viewable/opened from Form2, I'm looking for a way for the manager to add these files, and then have the project lead receive the files from Form2. Sorry if this is a confusing description, I do appreciate the help.
[Insert Witty Sig Here]
|
|
|
|
|
OK, so "Project" would be one of your classes; your manager would use a "ProjectEditForm" to view and alter a Project, he would have some means to add ("attach") relevant files to the Project (maybe through an OpenFileDialog indeed), and the list of attached files should be kept in a collection (maybe a List<string>) and displayed somehow (maybe a ListBox or a TreeView).
The lead does not get the files from the manager's form, he should have his view on the same Project, maybe through a "ProjectViewForm" which could be similar to a "ProjectEditForm" with fewer privileges (and maybe also more details).
In my view you want to persist a Project somehow, maybe in an XML file, maybe in a database.
Conclusion: it is not form-communicates-to-other-form, it is an object-needing-persistence-and-multiple-views.
Luc Pattyn [My Articles] Nil Volentibus Arduum
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Please use <PRE> tags for code snippets, they improve readability. CP Vanity has been updated to V2.3
|
|
|
|
|
Can anyone know why the case for i=2 is not executed? stateA, B, C & D are object of my small classes.
The problem is that node5 & node6 are put into the arrays but node3 & node4 are not.
I debugged my program to watch closely step by step but I did not find out what is wrong.
Anyone?
CODE:
for(System::Int32 i=0; i<numOfBits_int+3; i++){
switch(i)
{
case 0:
stateA^ node0 = gcnew stateA(i,0,-1,-1);
aux_trellis1a[i] = node0;
break;
case 1:
String^ str1 = encodedBits2->Text->Substring((position + 1)+(i-1)*3,2);
String^ str2 = aux_trellis1a[i-1]->output0;
String^ str3 = aux_trellis1a[i-1]->output1;
stateA^ node1 = gcnew stateA(i,aux_trellis1a[i-1]->metric + compareStrings(str1,str2),i-1,0);
stateB^ node2 = gcnew stateB(i,aux_trellis1a[i-1]->metric + compareStrings(str1,str3),i-1,1);
aux_trellis1a[i] = node1;
aux_trellis1b[i] = node2;
break;
case 2:
String^ str4 = encodedBits2->Text->Substring((position + 1)+(i-1)*3,2);
String^ str5 = aux_trellis1a[i-1]->output0;
String^ str6 = aux_trellis1a[i-1]->output1;
stateA^ node3 = gcnew stateA(i,aux_trellis1a[i-1]->metric + compareStrings(str4,str5),i-1,0);
stateB^ node4 = gcnew stateB(i,aux_trellis1a[i-1]->metric + compareStrings(str4,str6),i-1,1);
aux_trellis1a[i] = node3;
aux_trellis1b[i] = node4;
String^ str7 = encodedBits2->Text->Substring((position + 1)+(i-1)*3,2);
String^ str8 = aux_trellis1b[i-1]->output0;
String^ str9 = aux_trellis1b[i-1]->output1;
stateC^ node5 = gcnew stateC(i,aux_trellis1b[i-1]->metric + compareStrings(str7,str10),i-1,0);
stateD^ node6 = gcnew stateD(i,aux_trellis1b[i-1]->metric + compareStrings(str7,str11),i-1,1);
aux_trellis1c[i] = node5;
aux_trellis1d[i] = node6;
break;
}
}
modified on Thursday, May 26, 2011 7:11 AM
|
|
|
|
|
I don't see how it couldn't work unless numOfBits_int is <= -1.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
We don't have enough to go on.
What's numOfBits set to?
Do you reach the assignment statements or skip case 2 altogether?
Do any of the object ctors accept i by reference and change it?
John
|
|
|
|
|
numOfBits is always bigger than 3, so it's not a problem.
Case 2 is not skipped entirely because aux_trellis1c[2] and aux_trellis1d[2] are filled with appropriate nodes (node5 and node6). I worry why aux_trellis1a[2] and aux_trellis1b[2] are not filled when i has already reached value 3.
"i" is not changed by any other object, it is only internal argument for for loop.
Sorry for so lame description, I'm bad at programming, that is why I have stupid problems and probably the solution is very easy but I just can't see it:/
|
|
|
|
|
please use PRE tags when showing code snippets; they preserve indentation and improve readability. You could still edit your existing message!
Luc Pattyn [My Articles] Nil Volentibus Arduum
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Please use <PRE> tags for code snippets, they improve readability. CP Vanity has been updated to V2.3
|
|
|
|
|
OK, I don't see how it would be possible to execute the bottom half of a case.
I can only suggest you set a breakpoint at the first statement of case2 and single-step from there (assuming it goes wrong the very first time).
Luc Pattyn [My Articles] Nil Volentibus Arduum
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Please use <PRE> tags for code snippets, they improve readability. CP Vanity has been updated to V2.3
|
|
|
|
|