|
I have to build a small database that will be used by a VC++ application and I don't know a lot about creating a DB under Windows and interacting with it. I also need to use SQL Server and not Access. Does anybody know a good tutorial for this kind of situation because MSDN is really poor on the subject (only uses those crapy .mdb)
Thank you for your attention.
|
|
|
|
|
I have tried RegSaveKey to export HKCU and all its subkeys. In regedit, I export and got a text file. But in RegSaveKey, I got a binary file. Can I get the text file programmatically?
Thanks all!!!!!
|
|
|
|
|
I'd like to get some feedback from you guys about the best/proper way to use bitmasks.
I've seen them used in several ways, the most common I think is to do something like
#define BLAH 0x0001
So I was wondering what is the proper way to use them.
I've seen people use decimal number, hex numbers, ascending, decending, short, long and the list goes on and on.
So let me know what you guys think is a good strong coding practice to get into the habit of.
Thanks!
|
|
|
|
|
Whatever representation you use, they should be const variables rather than preprocessor macros.
Dave
|
|
|
|
|
Hi,
I want OpenDlg with out using any MFC ( like CFileDlg etc)
OPENFILENAME ofn;
memset(&ofn, 0, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hwnd;
ofn.hInstance = AfxGetInstanceHandle();
ofn.lpstrFilter = NULL;
ofn.lpstrCustomFilter = NULL ;
ofn.nMaxCustFilter = 0 ;
ofn.nFilterIndex = 0 ;
ofn.lpstrFile = lpcszFile ;
ofn.nMaxFile = MAX_PATH ;
ofn.lpstrFileTitle = lpcszFileTitle ;
ofn.nMaxFileTitle = MAX_PATH ;
ofn.lpstrInitialDir = NULL ;
ofn.lpstrTitle = NULL ;
ofn.Flags = OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY ;
ofn.nFileOffset = 0 ;
ofn.nFileExtension = 0 ;
ofn.lpstrDefExt = NULL ;
ofn.lCustData = NULL ;
ofn.lpfnHook = NULL ;
if( !GetOpenFileName(&ofn) )
I did not the openDialog.
can any body tell me where was the wrong?
Thanks,
-- Koteswara
|
|
|
|
|
i have a problem with the FlexGrid .
it causes the rc file to double each time i make the tiniest change in the size or even position of the grid on the Dlg.
help help help
adi peer
|
|
|
|
|
Can I have a CListCtrl in report view, and prevent the user from resizing the columns?
|
|
|
|
|
Hi everybody!
Situation: using a browser control to display html-pages hosting activeX controls.
Problem: tooltips doesn't work for all controls hosted in the html page.
Does anybody know how to enable/display tooltips for activeX - controls inside the html?
What I know is that every object inside the html has the IHTMLElement interface which has the property "title". This works fine for windowless controls but it seems to fail for "windowed" controls.
Any idea?
Thanks in advance!
Michael
|
|
|
|
|
i will be writing a client program for a VOIP product.
it requires me to enhance my Visual C++ GUI through skins.
My base GUI will be written in VC++ but the main dialog
will be skinned to enhance the appearance.
my colleague recommended ActiveSkin.
i have problems integrating it with my VC++ programs
any advice for VC++ with skin.
any other issue is that i may have to provide changeable
in the future.
|
|
|
|
|
Is it possibl to initiate a graphics mode in a standard C++ console application? If it is and you have before, i would praise you if you took a moment to copy\paste the source in a response to this message. I have Visual C++ 6.0 Standard Edition.
|
|
|
|
|
No, you can't initate graphics mode in a console application (which is what 32 bit VC creates). You can do so in a DOS application, but you would need a DOS targeting compiler.
You'll need to use standard Windows GDI, WinG, or DirectX.
|
|
|
|
|
Its been a while since I've used it, but I remember Allegro was a pretty good graphics library.
|
|
|
|
|
I have a function that keeps returning a value. For some reason, when I have at the end of that function
cout << "." << endl;
everything works, I get a new value each time. If I leave this command off or type cout << "."; I get an error in my calculations.
Several sources say "the endl command outputs a newline character and flush the stream". How can I "flush the stream" without creating a new line?
Any response any one can give me will be greatly appreciated.
Sincerely,
Erich J. Ruth
|
|
|
|
|
|
I really appreciate your response. I have gotten responses
from you before and they have always been helpful.
For some reason, I still can't get my code to work. I managed
to reduce it to the following error. If I type at the end
of my function
cout << "." << endl;
the code works fine, but I get along list of periods before
I get the answer. If I type
cout << ".";
or
cout << "." << "\n";
or
puts("");
or anything that doesn't have the endl command, then my
calculations are way, way, way off. It does not make any
sense to me why is works with endl. In a book I read,
it says endl "flushes the stream", but the command
cout.flush(): doesn't "flush" anything.
I am going nuts! Please any response you can give me will
be gretly appreciated.
Sincerely,
Erich J. Ruth (an overworked graduate student)
|
|
|
|
|
Let me go back one step and ask, do you know what flushing means? Standard output is normally line-buffered, so that any text sent to cout is not printed until an end-of-line character ('\n') is printed, or the program exits.
Flushing cout means that any text waiting to be printed is immediately printed.
Since the endl manipulator does an "end of line", it flushes cout . Calling cout.flush() does the same thing, just without going to a new line.
If the presence/absence of a cout method call is affecting code earlier in the function, I'd guess that you have a stack or buffer overrun somewhere in your code.
How exactly is your code going wrong when you don't have cout << endl; ?
--Mike--
http://home.inreach.com/mdunn/
|
|
|
|
|
> How exactly is your code going wrong when you don't have > cout << endl;?
If I leave the endl, I get no real errors, the computer doesn't crash or anything, I just get the wrong calculations, almost like it forgets or confuses simple addition.
If I insert endl, I get no errors and my calculations are dead-on.
I have a vague clue as to what flushing is.
I am stuck badly. Any other response, suggestions, anything will be greatly appreciated.
Sincerely,
Erich J. Ruth
|
|
|
|
|
You might try showing us how you are doing your calculations with some code. Showing us only the line withou cout doesn't help us figure out how you calculations can be mysteriously "wrong".
Try to isolate it to as small of a section of code as you possibly can.
|
|
|
|
|
Hi,
Here is a function (above) to browse Computers names on network.
It work but I have a problem to get the name of machine which is selected.
If i use this call :
CString strDir = BrowseForFolder(m_hWnd, "Select a folder", 0 );
with browseInfo.pidlRoot=NULL;
I obtain the name of folder selected.
BUT WITH THIS CALL
CString strDir = BrowseForFolder(m_hWnd, "selected a computer", BIF_BROWSEFORCOMPUTER );
with browseInfo.pidlRoot=(_ITEMIDLIST *)0x12;
The function browse very match only computer but my variable strDir is empty at the end.
I try to use this other function :
SHGetSpecialFolderPath(hWnd,szBuffer,CSIDL_NETHOOD ,0);
but i have a entry point problem to shell32.dll
Can anybody help me to get computer name?
Function
================================================================================
CString& CTestDlg::BrowseForFolder(HWND hWnd, LPCSTR lpszTitle, UINT nFlags)
{
static CString strResult = "";
LPMALLOC lpMalloc; // pointer to IMalloc
if (::SHGetMalloc(&lpMalloc) != NOERROR)
return strResult; // failed to get allocator
char szDisplayName[_MAX_PATH];
char szBuffer[_MAX_PATH];
BROWSEINFO browseInfo;
browseInfo.hwndOwner = hWnd;
// set root at Network Neighborhood ( if NULL then set root at Desktop )
browseInfo.pidlRoot = (_ITEMIDLIST *)0x12;
browseInfo.pszDisplayName = szDisplayName;
browseInfo.lpszTitle = lpszTitle;
browseInfo.ulFlags = nFlags;
browseInfo.lpfn = NULL; // not used
browseInfo.lParam = 0; // not used
LPITEMIDLIST lpItemIDList;
if ((lpItemIDList = ::SHBrowseForFolder(&browseInfo))
!= NULL)
{
// Get the path of the selected folder from the
// item ID list.
if (::SHGetPathFromIDList(lpItemIDList, szBuffer))
{
// At this point, szBuffer contains the path
// the user chose.
if (szBuffer[0] == '\0')
{
// SHGetPathFromIDList failed, or
// SHBrowseForFolder failed.
//AfxMessageBox(IDP_FAILED_GET_DIRECTORY,MB_ICONSTOP|MB_OK);
return strResult;
}
// We have a path in szBuffer!
// Return it.
strResult = szBuffer;
return strResult;
}
else
{
// The thing referred to by lpItemIDList
// might not have been a file system object.
// For whatever reason, SHGetPathFromIDList
// didn't work!
//AfxMessageBox(IDP_FAILED_GET_DIRECTORY,MB_ICONSTOP|MB_OK);
return strResult; // strResult is empty
}
lpMalloc->Free(lpItemIDList);
lpMalloc->Release();
}
// If we made it this far, SHBrowseForFolder failed.
return strResult;
}
|
|
|
|
|
I have a SDI application with a splitter: treeview on left and dialog in a formview on right. Every time I open a file, the window resizes to the default size (and only if it was bigger than the default size). What is causing that and how can I solve it.
Thanks
(Sorry if my English is not perfect: French dude)
|
|
|
|
|
i need to do a couple of things with TCL in a component of C++.
does anybody knows how can i do that????
i got the TCL script and the code of the component, but i need to run a script of TCL in the component.
Thanks!!!!!
|
|
|
|
|
I'm currently writing a Client Server Type application. In my experience in the past with DCOM its performance, even when optimized for DCOM, hasn't been that great and its reliablity in a WAN environment has been nothing to write home about. Unfortunatly for various reasons MTS isn't an option for me at this point. I have messed with Sockets in VB but not in VC++. Is it worth my time to investigate using sockets as apposed to DCOM especially since it appears that Microsoft is moving away from DCOM in favor of its .Net initiatives(SOAP & XML). In your experiences am I going in the wrong direction thinking of sockets. Am I just really far off in my thoughts here. Any advice would be appreciated. Thanks in advance.
|
|
|
|
|
I have two classes in a DLL. One class CStringDialog is for a dialog box. The other class CCaller contains one function DisplayDialog which calls the dialog using the DoModal function.
When I call the DisplayDialog function from another executable, the application get to the function, but does not display the dialog.
Any suggestions would be appretiated.
|
|
|
|
|
The code is probably looking in your application's resources for the dialog box resources. Try something like the following:
HINSTANCE h = (HINSTANCE)::GetModuleHandle("YourDLLName");
ASSERT(h);
HINSTANCE hPrevious = AfxGetResourceHandle();
AfxSetResourceHandle(h);
dlg.DoModal();
AfxSetResourceHandle (hPrevious);
|
|
|
|
|
I need to set the default file open folder for open file in a doc/view/mdi app. I know about the win32 api structure containing an initial folder parameter. The file is serialized.
Do I have to completely subclass the dialog or is there a way to modify that structure variable capturing the menu message on File Open and then pass to the standard CFileOpen without rewriting all of it?
Also, what module (MainFrame, ChildFrame, etc, do I capture the message and set the initial folder variable, then pass on to the standard function?
I do not want to start in My Documents but will load the default path from a parameter I've stored successfully in the registry.
This is a multi-template app depending on file extension, but for now all the files will be stored in one default folder. Nothing to set in the menu resource string tables for this?
|
|
|
|