answersLogoWhite

0

Displays a modal dialog box that contains a system icon, a set of buttons, and a brief application-specific message, such as status or error information. The message box returns an integer value that indicates which button the user clicked.

User Avatar

Wiki User

13y ago

What else can I help you with?

Continue Learning about Engineering

How do you make a message box in c plus plus?

#include<windows.h> int main() { MessageBox(0,"Hello","Welcome Message",1); return 0; }


How do you use string in visual basic?

A string is a data set in the form of alphanumeric characters and symbols. For example, if you wanted to use a string to concatenate and display a welcome message displaying a user's name, your code would look something like this: Dim WelcomeMessageString as String = "Welcome to the string demonstration " Dim FormResponseString as String = form1.text Message(WelcomeMessageString + FormResponseString)


How do you make a pop-up messagebox by pressing a button in visual basic?

Example: MsgBox("This is an example!", MsgBoxStyle.Information, "Example") or: MsgBox("This is an example!", MsgBoxStyle.Exclamation, "Example") or: MsgBox("This is an example!", MsgBoxStyle.Critical, "Example") you can choose between one of these three styles. just add one of these in the line where you want it to be displayed like: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click MsgBox("This is an example!", MsgBoxStyle.Information, "Example") End Sub


How do you read figures from a text file and write them in tabular form in an excel spreadsheet in c plus plus?

The following code is based upon Microsoft KB216686: How to automate Excel from C++ without using MFC or #import. The code creates some random data as a table, writing it to a text file in CSV format. This data is then read from the file, printed to std::cout (for verification) before being output to an excel worksheet. #include<iostream> #include<fstream> #include<sstream> #include<array> #include<random> #include<ctime> #include<ole2.h> template<const size_t R, const size_t C> class table_t { std::array<std::array<double, C>, R> data = {}; public: table_t () {} table_t (const table_t& rhs): data {rhs.data} {} table_t (table_t&& rhs): data (std::move (rhs.data)) {} table_t& operator= (const table_t& rhs) { data = rhs.data; } table_t& operator= (table_t&& rhs) { data = std::move (rhs.data); } std::array<double,C>& operator [] (const size_t row) { return data[row]; } const std::array<double,C>& operator [] (const size_t row) const { return data[row]; } size_t rows () const { return R; } size_t columns () const { return C; } std::wstring get_excel_range() const { std::wstringstream ss; ss << L"A1:"; size_t cols=C; while (cols) { ss << static_cast<char>((cols-1)%26+L'A'); cols /= 26; } ss << R; return ss.str(); } }; template<const size_t R, const size_t C> std::ostream& operator<< (std::ostream& os, const table_t<R,C>& table) { for (size_t row=0; row<R; ++row) { for (size_t col=0; col<C; ++col) { os << table[row][col]; if (col<C-1) os << ", "; } os << std::endl; } return os; } // forward declarations... void create_data (const std::string&, const size_t, const size_t); template<const size_t R, const size_t C> table_t<R,C> read_data (const std::string&); template<const size_t R, const size_t C> int write_to_excel (const table_t<R,C>&); HRESULT AutoWrap (int, VARIANT*, IDispatch*, LPOLESTR, int ...); int main() { const size_t rows=10; const size_t cols=5; const std::string textfile {"sample.txt"}; // create sample data... create_data (textfile, rows, cols); // read and print the sample data... table_t<rows, cols> table = read_data<rows, cols> (textfile); std::cout << "Sample data:\n\n"; std::cout << table << std::endl; // output data to excel... return write_to_excel (table); } // Function to create a sample CSV data file with random data. void create_data (const std::string& filename, const size_t rows, const size_t cols) { std::default_random_engine generator ((unsigned) time (0)); std::uniform_int_distribution<unsigned> distribution (0, 10000); std::ofstream os (filename); if (!os.bad()) { for (size_t row=0; row<rows; ++row) { for (size_t col=0; col<cols; ++col) { double d = distribution (generator); d /= 100; os << d; if (col!=cols-1) os << ", "; } os << '\n'; } } os.close(); } // Function to read a CSV file and return a table of doubles template<const size_t R, const size_t C> table_t<R,C> read_data (const std::string& filename) { table_t<R,C> table; size_t row=0; std::ifstream is (filename); std::string line; while (std::getline (is, line)) { size_t col=0; std::stringstream ss1; ss1 << line; std::string value; while (std::getline (ss1, value, ',')) { std::stringstream ss2; ss2 << value; double d; ss2 >> d; table[row][col] = d; ++col; } ++row; } is.close(); return table; } template<const size_t R, const size_t C> int write_to_excel (const table_t<R,C>& table) { // Initialize COM for this thread... CoInitialize (nullptr); // Get CLSID for our server... CLSID clsid; HRESULT hr = CLSIDFromProgID(L"Excel.Application", &clsid); if (FAILED(hr)) { ::MessageBox (nullptr, "CLSIDFromProgID() failed", "Error", 0x10010); return -1; } // Start server and get IDispatch... IDispatch *pXlApp; hr = CoCreateInstance (clsid, nullptr, CLSCTX_LOCAL_SERVER, IID_IDispatch, (void **)&pXlApp); if(FAILED(hr)) { ::MessageBox (nullptr, "Excel not registered properly", "Error", 0x10010); return -2; } // Make it visible (i.e. app.visible = 1) { VARIANT x; x.vt = VT_I4; x.lVal = 1; AutoWrap (DISPATCH_PROPERTYPUT, NULL, pXlApp, L"Visible", 1, x); } // Get Workbooks collection IDispatch *pXlBooks; { VARIANT result; VariantInit(&result); AutoWrap (DISPATCH_PROPERTYGET, &result, pXlApp, L"Workbooks", 0); pXlBooks = result.pdispVal; } // Call Workbooks.Add() to get a new workbook... IDispatch *pXlBook; { VARIANT result; VariantInit(&result); AutoWrap (DISPATCH_PROPERTYGET, &result, pXlBooks, L"Add", 0); pXlBook = result.pdispVal; } // Create a safearray of variants... VARIANT arr; arr.vt = VT_ARRAY | VT_VARIANT; { SAFEARRAYBOUND sab[2]; sab[0].lLbound = 1; sab[0].cElements = table.rows(); sab[1].lLbound = 1; sab[1].cElements = table.columns(); arr.parray = SafeArrayCreate(VT_VARIANT, 2, sab); } // Fill safearray with values from the table... for (size_t row=0; row<table.rows(); ++row) { for (size_t col=0; col<table.columns(); ++col) { // Create value VARIANT tmp; tmp.vt = VT_R8; tmp.dblVal = table[row][col]; // Add to safearray... long indices[] = {row+1,col+1}; SafeArrayPutElement (arr.parray, indices, (void *)&tmp); } } // Get ActiveSheet object IDispatch *pXlSheet; { VARIANT result; VariantInit(&result); AutoWrap (DISPATCH_PROPERTYGET, &result, pXlApp, L"ActiveSheet", 0); pXlSheet = result.pdispVal; } // Get Range object... IDispatch *pXlRange; { VARIANT parm; parm.vt = VT_BSTR; parm.bstrVal = ::SysAllocString (table.get_excel_range().c_str()); VARIANT result; VariantInit (&result); AutoWrap (DISPATCH_PROPERTYGET, &result, pXlSheet, L"Range", 1, parm); VariantClear (&parm); pXlRange = result.pdispVal; } // Set range with our safearray... AutoWrap (DISPATCH_PROPERTYPUT, nullptr, pXlRange, L"Value", 1, arr); // Wait for user... ::MessageBox (nullptr, "All done.", "Notice", 0x10000); // Set .Saved property of workbook to TRUE so we aren't prompted // to save when we tell Excel to quit... { VARIANT x; x.vt = VT_I4; x.lVal = 1; AutoWrap (DISPATCH_PROPERTYPUT, nullptr, pXlBook, L"Saved", 1, x); } // Tell Excel to quit (i.e. App.Quit) AutoWrap (DISPATCH_METHOD, nullptr, pXlApp, L"Quit", 0); // Release references... pXlRange->Release(); pXlSheet->Release(); pXlBook->Release(); pXlBooks->Release(); pXlApp->Release(); VariantClear(&arr); // Uninitialize COM for this thread... CoUninitialize(); return 0; } // AutoWrap() - Automation helper function... HRESULT AutoWrap (int autoType, VARIANT *pvResult, IDispatch *pDisp, LPOLESTR ptName, int cArgs...) { // Begin variable-argument list... va_list marker; va_start (marker, cArgs); if (!pDisp) { MessageBox (nullptr, "NULL IDispatch passed to AutoWrap()", "Error", 0x10010); _exit (0); } // Variables used... DISPPARAMS dp = {nullptr, nullptr, 0, 0}; DISPID dispidNamed = DISPID_PROPERTYPUT; DISPID dispID; HRESULT hr; char buf[200]; char szName[200]; // Convert down to ANSI WideCharToMultiByte (CP_ACP, 0, ptName, -1, szName, 256, nullptr, nullptr); // Get DISPID for name passed... hr = pDisp->GetIDsOfNames (IID_NULL, &ptName, 1, LOCALE_USER_DEFAULT, &dispID); if (FAILED (hr)) { sprintf (buf, "IDispatch::GetIDsOfNames("%s") failed w/err 0x%08lx", szName, hr); MessageBox (nullptr, buf, "AutoWrap()", 0x10010); _exit (0); return hr; } // Allocate memory for arguments... VARIANT *pArgs = new VARIANT[cArgs+1]; // Extract arguments... for (int i=0; i<cArgs; i++) { pArgs[i] = va_arg (marker, VARIANT); } // Build DISPPARAMS dp.cArgs = cArgs; dp.rgvarg = pArgs; // Handle special-case for property-puts! if (autoType & DISPATCH_PROPERTYPUT) { dp.cNamedArgs = 1; dp.rgdispidNamedArgs = &dispidNamed; } // Make the call! hr = pDisp->Invoke (dispID, IID_NULL, LOCALE_SYSTEM_DEFAULT, autoType, &dp, pvResult, nullptr, nullptr); if (FAILED (hr)) { sprintf (buf, "IDispatch::Invoke("%s"=%08lx) failed w/err 0x%08lx", szName, dispID, hr); MessageBox (nullptr, buf, "AutoWrap()", 0x10010); _exit (0); return hr; } // End variable-argument section... va_end(marker); delete [] pArgs; return hr; }


How do you Access MS Access from C?

The following example creates an OracleConnection and sets some of its properties in the connection string. * ** Syntax based on .NET Framework version 1.1 ** #using #using #using using namespace System; using namespace System::Data; using namespace System::Data::OracleClient; __gc class COracleConnection{ public:void CreateOracleConnection( ){ String* myConnString Oracle8i;Integrated Security new OracleConnection( myConnString ); myConnection->Open( ); MessageBox::Show( String::Format( S"ServerVersion: {0}\nDataSource:{1}", myConnection->ServerVersion, myConnection->DataSource ) ); myConnection->Close(); } }; // This is the entry point for this application #ifdef _UNICODE int wmain( void ) #else int main( void ) #endif { COracleConnection *pCOracleConnection = new COracleConnection(); pCOracleConnection->CreateOracleConnection( ); return 0; } You will use Oracle's API. Its called OCI for Oracle Call Interface -- use Google for details about its usage. You can also use OTL, which is the Oracle Template Library. Its much easier to use than OCI. Additionally, you can use embedded sql and precompile this code into pure C using the Oracle Pro*C/C++ precompiler. Sample code exists in ORACLE_HOME/precomp/demo/proc and ORACLE_HOME/rdbms/demo. As Oracle is the largest database company in the world with the largest market share of enterprise s/w, you can bet there is code all over the internet to do what you want to do. Check the forums at otn.oracle.com, google (or other search engine), or asktom.oracle.com. Answer You can also use library such as OCILIB (wraper for OCI) and Libsqlora. The other solution is use UnixODBC for unix programming environtment. Visit www.alldatabaseprogramming.blogspot.com or www.gtkinaction.blogspot.com for further information.

Related Questions

How can change font size on MessageBox in VB?

Unforunately No. Your best bet is to create your own Messagebox dialog using a simple WindowsForm. Then add the buttons and text, ect.. to mimick the messagebox you have in mind.


How do you make a message box in c plus plus?

#include<windows.h> int main() { MessageBox(0,"Hello","Welcome Message",1); return 0; }


What is the use of MSGBOX in Visual Basic?

MessageBox is a way to show a message when the user does a specific thing. There is two ways to do it, you can use: MsgBox("text", MsgBoxStyle.whatever, "title) or MessageBox.Show("text", "title")


How do you use string in visual basic?

A string is a data set in the form of alphanumeric characters and symbols. For example, if you wanted to use a string to concatenate and display a welcome message displaying a user's name, your code would look something like this: Dim WelcomeMessageString as String = "Welcome to the string demonstration " Dim FormResponseString as String = form1.text Message(WelcomeMessageString + FormResponseString)


What is pop up window in fox pro?

In FoxPro, a pop-up window refers to a dialog box that temporarily appears on the screen to interact with the user. It can be used to display messages, prompt for input, or provide options, allowing users to make selections or enter data without navigating away from the main interface. Pop-up windows enhance user experience by facilitating quick interactions in a controlled manner. They can be created using built-in commands and functions in FoxPro, such as MESSAGEBOX or custom forms.


How do you make a pop-up messagebox by pressing a button in visual basic?

Example: MsgBox("This is an example!", MsgBoxStyle.Information, "Example") or: MsgBox("This is an example!", MsgBoxStyle.Exclamation, "Example") or: MsgBox("This is an example!", MsgBoxStyle.Critical, "Example") you can choose between one of these three styles. just add one of these in the line where you want it to be displayed like: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click MsgBox("This is an example!", MsgBoxStyle.Information, "Example") End Sub


How will you create a net component for displaying daily greeting message to remote system?

Private Sub Command1_Click() Dim objAdd As New clsAddPublic.display MsgBox(objAdd.display()) End Sub Namespace Tester Public Interface Tester Function GetTime() as Integer End Interface ClassInterface(ClassInterfaceType.None),_ProgId("Tester.Numbers")> Public class Tester Implements Tester Public Tester() Public Function GetTime() As integer Implements Tester.GetTime Dim Time As Integer Time = DateTime.Now If (Time<12) MessageBox("GOOD MORNING") Elseif (Time=12) Msgbox("GOOD AFTERNOON") ElseIf(Time>18) Msgbox("GOOD NIGHT") End If End If End If End Function Bool CNickDlg::OnInitDialog() CDialog::OnInitDialog(); CString strmessage; Tester::Time *com-ptr; CoInitialize(NULL); Tester::NumbersPtr p(Tester::Time); Com-ptr = t; Int t-Time = com_ptr -> GetTime(); SetIcon(m-hicon, TRUE); SetIcon(m-hicon, False); End Namespace


How do you read figures from a text file and write them in tabular form in an excel spreadsheet in c plus plus?

The following code is based upon Microsoft KB216686: How to automate Excel from C++ without using MFC or #import. The code creates some random data as a table, writing it to a text file in CSV format. This data is then read from the file, printed to std::cout (for verification) before being output to an excel worksheet. #include<iostream> #include<fstream> #include<sstream> #include<array> #include<random> #include<ctime> #include<ole2.h> template<const size_t R, const size_t C> class table_t { std::array<std::array<double, C>, R> data = {}; public: table_t () {} table_t (const table_t& rhs): data {rhs.data} {} table_t (table_t&& rhs): data (std::move (rhs.data)) {} table_t& operator= (const table_t& rhs) { data = rhs.data; } table_t& operator= (table_t&& rhs) { data = std::move (rhs.data); } std::array<double,C>& operator [] (const size_t row) { return data[row]; } const std::array<double,C>& operator [] (const size_t row) const { return data[row]; } size_t rows () const { return R; } size_t columns () const { return C; } std::wstring get_excel_range() const { std::wstringstream ss; ss << L"A1:"; size_t cols=C; while (cols) { ss << static_cast<char>((cols-1)%26+L'A'); cols /= 26; } ss << R; return ss.str(); } }; template<const size_t R, const size_t C> std::ostream& operator<< (std::ostream& os, const table_t<R,C>& table) { for (size_t row=0; row<R; ++row) { for (size_t col=0; col<C; ++col) { os << table[row][col]; if (col<C-1) os << ", "; } os << std::endl; } return os; } // forward declarations... void create_data (const std::string&, const size_t, const size_t); template<const size_t R, const size_t C> table_t<R,C> read_data (const std::string&); template<const size_t R, const size_t C> int write_to_excel (const table_t<R,C>&); HRESULT AutoWrap (int, VARIANT*, IDispatch*, LPOLESTR, int ...); int main() { const size_t rows=10; const size_t cols=5; const std::string textfile {"sample.txt"}; // create sample data... create_data (textfile, rows, cols); // read and print the sample data... table_t<rows, cols> table = read_data<rows, cols> (textfile); std::cout << "Sample data:\n\n"; std::cout << table << std::endl; // output data to excel... return write_to_excel (table); } // Function to create a sample CSV data file with random data. void create_data (const std::string& filename, const size_t rows, const size_t cols) { std::default_random_engine generator ((unsigned) time (0)); std::uniform_int_distribution<unsigned> distribution (0, 10000); std::ofstream os (filename); if (!os.bad()) { for (size_t row=0; row<rows; ++row) { for (size_t col=0; col<cols; ++col) { double d = distribution (generator); d /= 100; os << d; if (col!=cols-1) os << ", "; } os << '\n'; } } os.close(); } // Function to read a CSV file and return a table of doubles template<const size_t R, const size_t C> table_t<R,C> read_data (const std::string& filename) { table_t<R,C> table; size_t row=0; std::ifstream is (filename); std::string line; while (std::getline (is, line)) { size_t col=0; std::stringstream ss1; ss1 << line; std::string value; while (std::getline (ss1, value, ',')) { std::stringstream ss2; ss2 << value; double d; ss2 >> d; table[row][col] = d; ++col; } ++row; } is.close(); return table; } template<const size_t R, const size_t C> int write_to_excel (const table_t<R,C>& table) { // Initialize COM for this thread... CoInitialize (nullptr); // Get CLSID for our server... CLSID clsid; HRESULT hr = CLSIDFromProgID(L"Excel.Application", &clsid); if (FAILED(hr)) { ::MessageBox (nullptr, "CLSIDFromProgID() failed", "Error", 0x10010); return -1; } // Start server and get IDispatch... IDispatch *pXlApp; hr = CoCreateInstance (clsid, nullptr, CLSCTX_LOCAL_SERVER, IID_IDispatch, (void **)&pXlApp); if(FAILED(hr)) { ::MessageBox (nullptr, "Excel not registered properly", "Error", 0x10010); return -2; } // Make it visible (i.e. app.visible = 1) { VARIANT x; x.vt = VT_I4; x.lVal = 1; AutoWrap (DISPATCH_PROPERTYPUT, NULL, pXlApp, L"Visible", 1, x); } // Get Workbooks collection IDispatch *pXlBooks; { VARIANT result; VariantInit(&result); AutoWrap (DISPATCH_PROPERTYGET, &result, pXlApp, L"Workbooks", 0); pXlBooks = result.pdispVal; } // Call Workbooks.Add() to get a new workbook... IDispatch *pXlBook; { VARIANT result; VariantInit(&result); AutoWrap (DISPATCH_PROPERTYGET, &result, pXlBooks, L"Add", 0); pXlBook = result.pdispVal; } // Create a safearray of variants... VARIANT arr; arr.vt = VT_ARRAY | VT_VARIANT; { SAFEARRAYBOUND sab[2]; sab[0].lLbound = 1; sab[0].cElements = table.rows(); sab[1].lLbound = 1; sab[1].cElements = table.columns(); arr.parray = SafeArrayCreate(VT_VARIANT, 2, sab); } // Fill safearray with values from the table... for (size_t row=0; row<table.rows(); ++row) { for (size_t col=0; col<table.columns(); ++col) { // Create value VARIANT tmp; tmp.vt = VT_R8; tmp.dblVal = table[row][col]; // Add to safearray... long indices[] = {row+1,col+1}; SafeArrayPutElement (arr.parray, indices, (void *)&tmp); } } // Get ActiveSheet object IDispatch *pXlSheet; { VARIANT result; VariantInit(&result); AutoWrap (DISPATCH_PROPERTYGET, &result, pXlApp, L"ActiveSheet", 0); pXlSheet = result.pdispVal; } // Get Range object... IDispatch *pXlRange; { VARIANT parm; parm.vt = VT_BSTR; parm.bstrVal = ::SysAllocString (table.get_excel_range().c_str()); VARIANT result; VariantInit (&result); AutoWrap (DISPATCH_PROPERTYGET, &result, pXlSheet, L"Range", 1, parm); VariantClear (&parm); pXlRange = result.pdispVal; } // Set range with our safearray... AutoWrap (DISPATCH_PROPERTYPUT, nullptr, pXlRange, L"Value", 1, arr); // Wait for user... ::MessageBox (nullptr, "All done.", "Notice", 0x10000); // Set .Saved property of workbook to TRUE so we aren't prompted // to save when we tell Excel to quit... { VARIANT x; x.vt = VT_I4; x.lVal = 1; AutoWrap (DISPATCH_PROPERTYPUT, nullptr, pXlBook, L"Saved", 1, x); } // Tell Excel to quit (i.e. App.Quit) AutoWrap (DISPATCH_METHOD, nullptr, pXlApp, L"Quit", 0); // Release references... pXlRange->Release(); pXlSheet->Release(); pXlBook->Release(); pXlBooks->Release(); pXlApp->Release(); VariantClear(&arr); // Uninitialize COM for this thread... CoUninitialize(); return 0; } // AutoWrap() - Automation helper function... HRESULT AutoWrap (int autoType, VARIANT *pvResult, IDispatch *pDisp, LPOLESTR ptName, int cArgs...) { // Begin variable-argument list... va_list marker; va_start (marker, cArgs); if (!pDisp) { MessageBox (nullptr, "NULL IDispatch passed to AutoWrap()", "Error", 0x10010); _exit (0); } // Variables used... DISPPARAMS dp = {nullptr, nullptr, 0, 0}; DISPID dispidNamed = DISPID_PROPERTYPUT; DISPID dispID; HRESULT hr; char buf[200]; char szName[200]; // Convert down to ANSI WideCharToMultiByte (CP_ACP, 0, ptName, -1, szName, 256, nullptr, nullptr); // Get DISPID for name passed... hr = pDisp->GetIDsOfNames (IID_NULL, &ptName, 1, LOCALE_USER_DEFAULT, &dispID); if (FAILED (hr)) { sprintf (buf, "IDispatch::GetIDsOfNames("%s") failed w/err 0x%08lx", szName, hr); MessageBox (nullptr, buf, "AutoWrap()", 0x10010); _exit (0); return hr; } // Allocate memory for arguments... VARIANT *pArgs = new VARIANT[cArgs+1]; // Extract arguments... for (int i=0; i<cArgs; i++) { pArgs[i] = va_arg (marker, VARIANT); } // Build DISPPARAMS dp.cArgs = cArgs; dp.rgvarg = pArgs; // Handle special-case for property-puts! if (autoType & DISPATCH_PROPERTYPUT) { dp.cNamedArgs = 1; dp.rgdispidNamedArgs = &dispidNamed; } // Make the call! hr = pDisp->Invoke (dispID, IID_NULL, LOCALE_SYSTEM_DEFAULT, autoType, &dp, pvResult, nullptr, nullptr); if (FAILED (hr)) { sprintf (buf, "IDispatch::Invoke("%s"=%08lx) failed w/err 0x%08lx", szName, dispID, hr); MessageBox (nullptr, buf, "AutoWrap()", 0x10010); _exit (0); return hr; } // End variable-argument section... va_end(marker); delete [] pArgs; return hr; }


What is the Differentiate between dos based programming and windows programming?

A DOS program's output/input is based souly on the DOS proment, while a win api based program is based within its own window. Code is untested! // DOS Prompt Code c/c++ - With output #include <iostream> // Input Output Stream int main() { std::cout << "Hello World"; // Output Command return 0; } // Win Api Code c/c++ just window #include <windows.h> LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,PSTR szCmdLine, int iCmdShow) { static TCHAR szAppName[] = TEXT ("Opengl"); HWND hwnd; WNDCLASS wndclass; HDC hdc; MSG msg; HGLRC hrc; wndclass.style = CS_HREDRAW | CS_VREDRAW; wndclass.lpfnWndProc = WndProc; wndclass.cbClsExtra = 0; wndclass.cbWndExtra = 0; wndclass.hInstance = hInstance; wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION); wndclass.hCursor = LoadCursor (NULL, IDC_ARROW); wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH); wndclass.lpszMenuName = NULL; wndclass.lpszClassName = szAppName; if (!RegisterClass (&wndclass)) { MessageBox (NULL, TEXT ("This program requires Windows NT!"), szAppName, MB_ICONERROR); return 0; } hwnd = CreateWindow (szAppName, TEXT ("OpengGL"), WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL); ShowWindow (hwnd, iCmdShow); UpdateWindow (hwnd); while (GetMessage (&msg, NULL, 0, 0)) { TranslateMessage (&msg); DispatchMessage (&msg); } return msg.wParam; } LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_PAINT: opengl.callDisplayFunc(); return 0; case WM_SIZE: return 0; case WM_KEYDOWN: switch(wParam) { case VK_ESCAPE: SendMessage(hwnd,WM_DESTROY,wParam,lParam); break; } return 0; case WM_DESTROY: PostQuitMessage(0); return 0; } return DefWindowProc (hwnd, message, wParam, lParam); }


How can you create a dll file?

Steps to Create Your First DLLCreate a Win32 Dynamic Link Library project, adding a *.cpp and a *.h file.In the *.cpp file, create a class instantiated from the CWinApp file. Collapse | Copy Code # include # include "SourceFile.h" class CDllApp : public CWinApp { public: CDllApp::CDllApp() { Calc(0,0); } DECLARE_MESSAGE_MAP() }; BEGIN_MESSAGE_MAP(CDllApp,CWinApp) END_MESSAGE_MAP() CDllApp DllObject;In the *.h file (here it is SourceFile.h), define the functions to be used. Also specify the dllexport value for the _declspec function. Collapse | Copy Code extern "C" _declspec(dllexport) int Calc(char no1,char no2) { char result; result = no1 + no2; return result; }Then compile the DLL.Create a normal Win32 Application with a *.cppfile and a *.h file.In the *.h file, (here it is AppHeader.h ), declare the function with the dllimport value of _declspec. Collapse | Copy Code extern "C" _declspec(dllimport) Calc(int FirstValue, int SecondValue);In the *.cpp file, use the function. Collapse | Copy Code # include "AFXWIN.H" # include "AppHeader.h" class MainFrame : public CFrameWnd { public: MainFrame() { Create(0,"Trial"); } void OnLButtonDown(UINT nFlags,CPoint point) { int res; char str[5]; res = Calc(998,226); sprintf(str,"%d",res); MessageBox(str); } DECLARE_MESSAGE_MAP() };In the Link tab of the "Project->Settings" dialog, go to the text box labeled "Object / Library Modules" and specify the path of the DLL file. Then copy the compiled DLL file to your current appliation path directory and run the program.


How do you Access MS Access from C?

The following example creates an OracleConnection and sets some of its properties in the connection string. * ** Syntax based on .NET Framework version 1.1 ** #using #using #using using namespace System; using namespace System::Data; using namespace System::Data::OracleClient; __gc class COracleConnection{ public:void CreateOracleConnection( ){ String* myConnString Oracle8i;Integrated Security new OracleConnection( myConnString ); myConnection->Open( ); MessageBox::Show( String::Format( S"ServerVersion: {0}\nDataSource:{1}", myConnection->ServerVersion, myConnection->DataSource ) ); myConnection->Close(); } }; // This is the entry point for this application #ifdef _UNICODE int wmain( void ) #else int main( void ) #endif { COracleConnection *pCOracleConnection = new COracleConnection(); pCOracleConnection->CreateOracleConnection( ); return 0; } You will use Oracle's API. Its called OCI for Oracle Call Interface -- use Google for details about its usage. You can also use OTL, which is the Oracle Template Library. Its much easier to use than OCI. Additionally, you can use embedded sql and precompile this code into pure C using the Oracle Pro*C/C++ precompiler. Sample code exists in ORACLE_HOME/precomp/demo/proc and ORACLE_HOME/rdbms/demo. As Oracle is the largest database company in the world with the largest market share of enterprise s/w, you can bet there is code all over the internet to do what you want to do. Check the forums at otn.oracle.com, google (or other search engine), or asktom.oracle.com. Answer You can also use library such as OCILIB (wraper for OCI) and Libsqlora. The other solution is use UnixODBC for unix programming environtment. Visit www.alldatabaseprogramming.blogspot.com or www.gtkinaction.blogspot.com for further information.


Full form of dim in visual basic language?

DIM stands for declaration in memory. the words DIM is used to declare a variable. Yes Correct, I used to declare variable. I think it means Dimension, Dimension Of the memory location The original Basic language did not require or have a type definition. All variables were numeric with no distinction between integer and real/float. Assigning space for a variable was easy, they were all the same type and size. Some Basic implementations, using variable name modification, later added character variables by a dollar sign appended (varname$) and an integer type with a percent sign (varname%) leaving the unsuffixed version as it originally was. You were allowed to have all three versions of a name in play at the same time so Basic still had no type declarations. For an array, you needed to tell Basic how much space to allocate for the array. Some of the more used languages at that time (e.g. fortran) used a"Dimension" keyword for this and Basic similarly used a shorter DIM statement. Being that the designers of VB were implementing a version of Basic and they did need a type declaration, I would guess they decided to use the closest thing available: A DIM statement.