|
Sounds like the writer program needs to set an Event and the monitoring program can WaitForSingleObject on that Event.
|
|
|
|
|
Hi, I'm writing a function which will create a copy of a tree. The traversal code for source tree is fine, but there is some problem assigning parent node in the destination tree. Please Help!!
extern const CTreeCtrl* m_pSourceTree;
CTreeCtrl m_DestTree;
HTREEITEM m_hDest;
TreeTraverse(m_pSourceTree->GetRootItem());
TREEITEM CKleenCachePage::TreeTraverse(HTREEITEM hStart)
{
HTREEITEM theItem;
if ( hStart == NULL )
return NULL;
if( m_pSourceTree->GetParentItem(hStart) == NULL)
m_hDest= NodeCopy(hStart,NULL);
if ((theItem = m_DestTree.GetChildItem(hStart)) != NULL)
{
m_hDest = NodeCopy(theItem,m_hDest);
theItem = TreeTraverse(theItem);
if (theItem != NULL)
return theItem;
}
if ((theItem = m_DestTree.GetNextSiblingItem(hStart)) != NULL)
{
m_hDest = NodeCopy(theItem,m_hDest);
theItem = TreeTraverse(theItem);
if (theItem != NULL)
return theItem;
}
return theItem;
}
<BR>
HTREEITEM CKleenCachePage::NodeCopy(HTREEITEM hSource, HTREEITEM hDest)
{
int nImage = 0, nSelectedImage = 0;
CString csText = m_pSourceTree->GetItemText(hSource);
m_pSourceTree->GetItemImage(hSource,nImage, nSelectedImage);
return m_DestTree.InsertItem(csText,nImage,nSelectedImage,hDest,TVI_LAST);
}
|
|
|
|
|
I want to build executable with shared MFC dlls to reduce the final size.
But VS7 link my exe file with shared mfc70.dll which is not available on default win98.
So I think I need to link my exe against mfc42.dll which is available on most systems.
What I should gonna do?
|
|
|
|
|
The usual thing to do is distribute the DLL along with your program. It's simple to do if you're packing everything into an intallation executable.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thank you. But in my situation the final size is critical. The aplication is just a some free add-on to some other application. So all should be kept in one executable and size should be no more then 100kB.
|
|
|
|
|
Both mfc42.dll and mfc70.dll are redistributable files there is no garantee that either one already exist on the users machine. Therefore, even if you link with mfc42.dll you still need to include it in the install. If you do not want to include the MFC DLL in your installs then you should not be using MFC.
Trust in the code Luke. Yea right!
|
|
|
|
|
I want to get the Sql Server Name in a local network, how can i to do?
Thanks!
|
|
|
|
|
Variant SQLServer;
Variant ServerList;
int i,nServers;
String sRetValue;
try
{
SQLServer = CreateOleObject("SQLDMO.Application");
}
catch(...)
{
ShowMessage("no SQL Server or SQL Server client!");
return;
}
ServerList= SQLServer.OleFunction("ListAvailableSQLServers");
nServers=ServerList.OlePropertyGet("Count");
ComboBox1->Items->Clear();
for(i=1;i<=nServers;i++)
ComboBox1->Items->Add(ServerList.OleFunction("Item",i));
SQLServer=Unassigned;
ServerList=Unassigned;
///////////////////////////////////
other:
int i;
LPSERVER_INFO_101 pBuf = NULL;
LPSERVER_INFO_101 pTmpBuf;
DWORD dwLevel = 101;
DWORD dwPrefMaxLen = MAX_PREFERRED_LENGTH;
DWORD dwEntriesRead = 0;
DWORD dwTotalEntries = 0;
DWORD dwTotalCount = 0;
DWORD dwServerType = SV_TYPE_SQLSERVER; // SQL server
DWORD dwResumeHandle = 0;
NET_API_STATUS nStatus;
wchar_t *pszServerName = NULL;
try
{
nStatus = NetServerEnum(pszServerName,
dwLevel,
(LPBYTE *) &pBuf,
dwPrefMaxLen,
&dwEntriesRead,
&dwTotalEntries,
dwServerType,
NULL,
&dwResumeHandle);
if ((nStatus == NERR_Success) || (nStatus == ERROR_MORE_DATA))
{
if ((pTmpBuf = pBuf) != NULL)
{
for (i = 0; i < dwEntriesRead; i++)
{
assert(pTmpBuf != NULL);
if (pTmpBuf == NULL)
{
return;
}
SList->Add((AnsiString)pTmpBuf->sv101_name);
pTmpBuf++;
dwTotalCount++;
}
}
}
if (pBuf != NULL)
NetApiBufferFree(pBuf);
}
catch(...)
{}
|
|
|
|
|
Thank you for your reply, but i have another question: how can i get the Sql Server Name that run on the server?
|
|
|
|
|
Do you mean the name of the Windows NT server that SQL Server is running on? How about GetComputerName[Ex]?
|
|
|
|
|
I mean I want to let my computer search SQL Server's computer name and SQL Server name and list them, but i don't hnow how to do it.
|
|
|
|
|
Try the sp_server_info stored procedure.
|
|
|
|
|
|
HI,my way is get sql server name!my answer is provider two way! the first way must install sql server client,the other way don't!
;P
|
|
|
|
|
What's the standard mapping mode for the device context of
a MFC SDI application? MM_TEXT ?
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
I've just got the special upgrade from version 2002 to version 2003.
1.) Is that possible to install the 2003 over 2002's directory, so that
I will not have two Visual Studio.Net? When I installed it, it asked me
where do I want to install, I installed it in a new directory. So I ended
up with VS.Net 2002 and 2003 coexist. If I install the 2003 in the same
directory where 2002 is, does that mean it will overwrite the 2002, so
it will end up just 2003? (I don't need 2002 anymore) Which one do you
recommand? How did you do it?
2.) Once I installed the upgrade, I found that the new feature in VC++
allows you to hide and show code(the + and - sign) very annoying. Is
there a way to disable it?
|
|
|
|
|
I recommend installing Visual Studio .NET 2003 in its default directory. That will allow you to have multiple versions of developer studio. Now, if you wanted to use the 2003 version only, then I highly recommend that you uninstall the older version before installing 2003.
Kuphryn
|
|
|
|
|
Concerning the second question. The oulining (the + and -)is availabe in version 2002 as well but it's not enabled by default.
To control this in 2002 you should go to Tools|Options then in the options dialog go to Text Editor->C/C++->Formatting and check or uncheck the Outlining option.
I dont know if there is a difference between the options dialog in 2002 and 2003 but I hope this could help.
|
|
|
|
|
i am using vc++ connect to mysql server using mysql++ api.But how am i going to add,modify and delete data????
siong
|
|
|
|
|
Are you using ODBC, ADO, or some other mechanism?
|
|
|
|
|
I'm working on a project and I'm including sockets. I've included <winsock.h> but when I try to use the socket() function, it says "unresolved external symbol _socket@12" Anybody know why it does this and/or how to fix it?
Thanks
|
|
|
|
|
|
|
Hi.
I am wondering about advantages and disadvantages for the following:
1. Making one DLL that hold MANY things. Or many smaller DLLs that hold only things useful for specific purposes (like graphing stuff, database stuff).
2. What happens when a DLL needs to call fucntions from another DLL and at the same time the main program will also need that other DLL. Will the system automatically load it only once etc? I am not too familiar with how this done but just want to confirm.
3. Is there an easy way to keep track of projects (specifically headers in the DLL projects etc) so that when a file is updated, it will automatically update. I do not want to add the header file to every porject file folder and try to keep track of everything like that. Knowing myself, I will definitely screw up somewhere along the way. Any ideas?
Thank you in advance!
|
|
|
|
|
1.Logically it's better to separate them based on tasks.
2.the OS manges this for you .. it loads the DLL and unloads it when no application needs it.
3.why don't try Visual source safe ? (Even if I don't like it myself )
|
|
|
|