|
I have always thought that a static library was just like collection of .obj files.
However, I recently tryed to seperate a bit of functionality from my app by, moving the files out and building them into a static .lib.
My problem when I do that is I now get all sorts of library conflicts when the main app links.
Is there more to static librarys than I realise?
|
|
|
|
|
Did you delete the .obj files of the files that were put into the static lib project?
Could you be a little more specific as to what library conflicts you are getting.
|
|
|
|
|
The conflicts were all standard librarys, like libcd.lib and libcmtd.lib, and some of the afx ones. I can't remember the exact names.
Thinking about it some more I think a possibility maybe is that it could have to do with some of the afx includes explicitly linking. Do they do that? If thats the case, then how do I get the static library to link with the same librarys as the main app, and if not ...
|
|
|
|
|
Ok, I've just learnt something new about VC. You can set the library type you want to link under C++/Code Generation.
Changed all my dependant libraries to the same as the main app and it works perfectly...
|
|
|
|
|
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!!!!!
|
|
|
|