|
I am not sure exactly what feedback you are expecting, as it really depends on what sort of GUI you wish to present to the user. Setting parameters could be anything from simple text input, drop down list or combo, slider, up/down control etc., all of which can be accomplished by using the various Windows Controls[^]. I would suggest looking at some of the sample articles here on CodeProject[^] to get some ideas about how other people have approached similar issues. You could also add some more detail to your question which would help us make more suggestions.
|
|
|
|
|
Thank you!
Sorry about my poor explanation!,
The working on a project which is windows console application. But as per my understanding, GUI can be only done in 'Windows Forms Applications'.
Will it be possible to change console applications to windows forms application, where I can find all tools for creating GUI??
|
|
|
|
|
Windows Forms applications use C++/CLI or C#. But you can create a Win32/MFC Windows application using the standard Windows controls. Since you already (I assume) have most of the code in your console app, converting it to Windows should not be too difficult (depending on your skill level), although the initial learning does take some time.
You can create a basic Windows application from the template supplied with Visual Studio, so it is worth starting with that to see how it is put together.
|
|
|
|
|
Thank you!.
I have been trying to convert my console application to windows form application.
While running I'm getting an error, following is the part of my main function..
int main(array<System::String ^> ^args)
{
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
<pre>
char fname[30];
char fpath[100]; char fpath1[100];
for(int i=0;i<NTRIALS/4;i++)
force_enable[i]=false;
for(int i=NTRIALS/4;i<NTRIALS;i++) </pre>
This was the error. I tried changing 'main' as 'WinMain' but it's not preceeding
error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
any suggestion greatly appreciated.
|
|
|
|
|
Your code above is using managed C++, not ordinary Win32. I suggest you start again and either create a proper Windows Forms application, or use standard unmanaged C++ or MFC.
|
|
|
|
|
Sorry for starting a new post but the problem with the blue background around the text happens when the richedit or parent Dialog Gains focus
Any help appreciated
modified 29-May-15 16:31pm.
|
|
|
|
|
Hi,
After I create and populate the my Rich Edit there is light blue Back ground when I hit enter it goes away
I was hoping the Following code snipet would solove the problem it hasn't the rich edit
is completely coverd up
CDC *richdc = Myrich->GetDC();
COLORREF prevcolor, currcolor;
currcolor = RGB(255,255,255);
prevcolor = richdc->SetBkColor(currcolor);
|
|
|
|
|
Don't paint controls in random places, it will never have the results you want. You should only do it in response to WM_PAINT messages, which are usually handled in the OnDraw or OnPaint method.
|
|
|
|
|
Hi,
I don't have a message map for my rich edit so this the code for OnPaint for the Parent
Dialog
After I streamin my data the data is displayed with a thin blue background this backgrounds surrounds just this text so I when I streamin 2 lines there is blue background white line
following it.
next line of text surrounded by the blue background I am trying to get rid of blue background when I inserted the OnPaint the entire rich edit is covered up
afx_msg void Show_storage::OnPaint()
{
CPaintDC richdc(Myrich);
richdc.SetBkColor(RGB(255,255,255));
}
|
|
|
|
|
Like I said before, you cannot just paint into a control as and when you like. You must only do it in its OnPaint member function.
|
|
|
|
|
(this is partly a rant, because it seems to be something really easy to do, but the framework makes it really hard to achieve).
I need to be able to change the background color of a CMFCButton when certain conditions happen in our application.
According to the documentation, I could use the method CMFCButton::SetFaceColor (Sets the background color for the button text); but this will get overridden (sp?) by the visual manager drawing method (CMFCBaseVisualManager::DrawPushButton ) and will have not effect.
Our application is under control of a CMFCVisualManager theme; so all controls are drawn to respect the current theme ( we want to have themes in our application).
There is a static method in CMFCButton to disable themes for ALL CMFCButtons; so that is a little bit overkill.
I could set the CMFCButton flag m_bDontUseWinXPTheme to TRUE (which will disable the theme for that particular button (I would need to inherit from CMFCButton) But that will change the look of the button (and if I want to keep some of the look, I would have to draw all of it manually).
Any insights, tips or hints on what would be the best way to change the background color of a CMFCButton without having to re-invent the wheel?
Thanks.
Max.
I'd rather be phishing!
|
|
|
|
|
Alas, think your only solution is to derive your own button from the MFC one and change the OnDraw() method (think that's what the draw method is called, going off memory). I had to do this for a set of buttons that reflected status on their color. It's not terribly hard to do once you've done it once.
|
|
|
|
|
Thanks,
That was just too easy...
I'd rather be phishing!
|
|
|
|
|
|
Thanks,
That was just too easy...
I'd rather be phishing!
|
|
|
|
|
I hate to say this, but I never cease to be amazed at the number of questions I manage to answer just by looking at the documentation.
|
|
|
|
|
I know.
When I originally looked at OnDraw, I did not want to use it because I expected to have to redraw everything (inner, outer, fill, text and theme support)
But it ended up to look something like:
OnDrawn(...)
{
if (condition)
pDC->FillRect(...);
else
pDC->FillRect(...);
__super::OnDraw(...)
}
I'd rather be phishing!
|
|
|
|
|
hi
i have grid view in asp.net project .and this grid view have different information in each page how can i use tool-tip in each cell
thanks
|
|
|
|
|
"i have grid view in asp.net"
Are you sure that are you on the right forum ?
|
|
|
|
|
well after hours of work I finally managed to combine 2 scripts that i worked on
The purpse of the code is to get an adress of the folder that includes different kind of files
and the code needs to open the folder that is near it (2 folders in 1 folder)
and compair each time 2 files 1 is the compairer and the second is on of the files that is in the path in argv[1]
but every time after I combined the code and tried to fix it theres a triggered breakpoint
If anyone could tell me how to solve the problems in my script I will be very greatfull
the part where it doesnt work is at the while in the function at the end
here is my code:
http://pastebin.com/C5BYSNYK
modified 24-May-15 11:10am.
|
|
|
|
|
You still have lines of code of the form:
char* entrenceToTheFolderBefore = (char*)malloc(NULL);
which, as I explained will lead to problems: you will either get strange results, or a program crash. If you are going to store data in the buffer returned from malloc then you must allocate enough space for the data you are going to copy into it. Anything less will cause your program to overwite other variables.
|
|
|
|
|
i cant allocate because it gives me garbage every time i add 1
or simply try to allocate
can you rewrite it to make more sence ?
|
|
|
|
|
OK, let us say that you have a path ("C:\Users\Noname\Documents\Test") in argv[1], and you now want to inspect a subdirectory called "images":
int argvSize = strlen(argv[1]); int mallocSize = argvSize + strlen(subdir) + 1 + 1;
char* newPath = (char*)malloc(mallocSize);
strcpy(newPath, argv[1]); strcat(newPath, "\\"); strcat(newPath, subdir);
|
|
|
|
|
for some odd reason it still adds me junk letters that 1 last null
int temp3 = location + 1;
char* entrenceToTheFolderBefore = (char*)malloc(sizeof(char)*temp3);
for (int i = 0; i < location; i++)
{
entrenceToTheFolderBefore[i] = argv[1][i];
}
puts(entrenceToTheFolderBefore);
is there any way we could communicate like through skype ? i have only 2 hours left before the handout
|
|
|
|
|
Yes because you are using the count from location to do the copy, which is the length of the string, and so will not include the null character. Use the code sample I gave you which makes use of standard library functions that will ensure your copied data is correctly structured.
a random user wrote: is there any way we could communicate like through skype ? Sorry, I do this in my own time and at my own speed. I will not be available much longer today.
|
|
|
|