Consider this:

I wrote this using Win32 API in Visual Studio 2010 Professional.
I have written a working console application and wish to "convert" it to run with a frontend. It is actually a lot simpler than it sounds, considering it is not a complicated program. It asks for a number k, a number n, and computes the result using a formula. It tests it to see if it's prime or composite, and tells you which.
The only thing that involves the GUI is input and output. Because I use MPIR, I cannot have the GUI output the calculated result, as it would not be of type uint but rather mpz_t.
I have gotten stuck, though.
For testing purposes (that is, familiarizing myself with the language a bit more), I programmatically created the boxes and buttons and am trying to simply take the input of k and display it in another box - just so I know how to do it.
Well, I can't.
Here is code I am trying to use:
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
switch(wParam)
{
case IDC_BUTTON1: // when Accept k is pressed
if(HIWORD(wParam) == BN_CLICKED) // when it's clicked, store input as k
{
unsigned long int kinput = GetDlgItemInt(hEdit, IDC_ENTER_K, NULL, TRUE);
mpz_t k;
mpz_set_ui ( k, kinput); //sets mpz_t k from ul kinput
SetDlgItemInt(hEdit3, IDC_PROTH, kinput, TRUE);
}
MessageBox(NULL, L"Value of k Accepted.", L"k Accepted", MB_ICONINFORMATION);
return TRUE;
And so I run debug mode, enter a k, and click the button. Instead of doing what I want it to, I see this:
Quote
This leads me to believe some sort of memory object is either not initialized or not present.
I was poring over MSDN for hours today and never saw anything along those lines.
Can someone help me out here? Thanks!

New Topic/Question
Reply



MultiQuote







|