Click here to Skip to main content
15,797,923 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I created a empty project clr that calls a c# works but it's a console application:
#using "consume_cs_indexers.dll"
//#include "DlgClass.h"
using namespace System;

int main() 
	IndexerClass ^ ic = gcnew IndexerClass;

	int result = ic->Add(3, 6);

	Console::WriteLine("Element #{0} = {1}", i, result);
	//MessageBoxA(GetSafeHwnd(), buf, "Message", MB_OK);


Is there a way to add a dialog?

What I have tried:

I tried adding a ui but I have an error, then I tried to add a resource dialog and then adding a class but project doesn't compile..
Updated 9-Mar-23 6:53am

Console applications do not have a UI, they are simple terminal style applications with text in and out. If you want to use UI compomnents then you need to create a UI application: WindowsForm, WPF, UWP etc. Both Microsoft and CodeProject have articles on the subjects.

As with your other question it is not clear what you are trying to do, but it may be that switching to C# would be a better choice of language.
Share this answer
Member 14594285 9-Mar-23 11:57am    
I solved..I found a guide in google
As Richard notes, there's no GUI for the console. However there are a number of TUI libraries out there that may help with things like dialogs, pull-down menus, etc, like this one: GitHub - magiblot/tvision: A modern port of Turbo Vision 2.0, the classical framework for text-based user interfaces. Now cross-platform and with Unicode support.[^]
Disclaimer: I have not tried this - or any TUI library for Windows - so I can't comment on how useful it might be. But the one listed here is a port of the well regarded Borland TurboVision. Seeing as its cross platform, it might be worth investigating. If not, maybe a google search for "Windows TUI C++ library" might produce something more to your liking.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900