|
Thanks for your advice.
How can I define an array of 25 strings each of 255 bytes, i.e.
String[01] of 255 bytes
String[02] of 255 bytes
String[03] of 255 bytes
:
:
String[25] of 255 bytes
Thank you.
wavewave
|
|
|
|
|
How to use this API to get the info of remote machines? Here is my sample code.. I am getting a memory error . Can anyone suggest me where i went wrong. Is there any other way to pass the first argument(machine name) to the API?
////////////////////
//getting details of machines
wchar_t *tmp4=(wchar_t *)malloc(sizeof( wchar_t ));
strcat(mbstr2,tempname[snum]);
mbstr2[strlen(mbstr2)]='\0';
size_t x=strlen(mbstr2);
mbstowcs(tmp4,mbstr2,x);
WKSTA_INFO_101 *level=NULL;
LPTSTR tmp7=(LPTSTR)tmp4;
NET_API_STATUS nwData=NetWkstaGetInfo(tmp7,101,(LPBYTE*)&level);
if(nwData==NERR_Success)
{
int iLen3=wcslen ((unsigned short *)level->wki101_computername);
for(int j=0;j<ilen3;j++)
{
="" name[j]="*(level-">wki101_computername);
level->wki101_computername++;
level->wki101_computername++;
}
name[j]='\0';
AfxMessageBox(name);
//////////////////
Kindly help.
Regards,
Vini
|
|
|
|
|
I don't understand all that string manipulation at the beginning.
The first param is either NULL to use the local computer, or a Unicode string holding the name of the computer to get info for, for example L"\\Servername"
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
BUY MY SOFTWARE!! (please?) RightClick-Encrypt | 1ClickPicGrabber
My IntarWeb Homepgae!!!11
|
|
|
|
|
Michael Dunn wrote:
don't understand all that string manipulation at the beginning.
The first param is either NULL to use the local computer, or a Unicode string holding the name of the computer to get info for, for example L"\\Servername"
I want to give the first argument at run time(not a NULL value),means give the selected machine name from a list box or edit box. The initial string manipulations were used to convert the value in a CString variable to the type of the first parameter . is it not required? Kidly help..
Vini
|
|
|
|
|
Use the T2CW macro to do that
#include <atlconv.h>
{
USES_CONVERSION;
NetWkstaGetInfo ( T2CW(LPCTSTR(sComputerName)), ... );
}
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
|
|
|
|
|
Hi, I am writing an application that has plugins (DLLs). Each DLL has a child window that resides in the application's main dialog window. Some of the plugins need to use web services, however, when I attempt to use the CHtmlView in the child window of the DLL, I crash and burn every time. If I move the same code to the master program, it works.
I tried modifying the DLL to have it's own dialog window, and still both CHtmlView and even the ActiveX MS WebBrowser control do not work. They crash on initialization of the child dialog (dialog never even gets created). This leads me to believe it isn't the child dialog that is the problem, it is DLL + HtmlView = boom....
Has anyone had any success with this type of thing?
Thanks in advance!!
By the time you read this you will have already read it.
|
|
|
|
|
Hey all,
Figured it out. In case you ever run into this problem, the solution is to not only call AfxEnableControlContainer() from your DLL's InitInstance(), but you must also first call CoInitialize(NULL) as well.
|
|
|
|
|
I would like to create a Photoshop plugin to read/write a custom image file format. Does anyone know how to do this or any resources available on the topic?
|
|
|
|
|
Actually, I figured it out. There is an "Adobe Photoshop SDK" on the Adobe Photoshop CD (Version 6.0 and earlier -- apparently they started charging for it in Version 7.0).
Regards, Larry
|
|
|
|
|
How can I get rid of the black line drawn at the bottom of a tab control? None of the options on the property pages seem to do it without adding other lines in places i don't want, and i don't see any member functions that would do it. I want a control that has the dialog face color on its bottom edge (like a typical property page tab set), not black.
-c
When history comes, it always takes you by surprise.
|
|
|
|
|
derive the control !
onncpaint
framerect(clientrect,getsyscolorbursh(COLOR_3DFACE));
that`s it ! no more border !
I am the mighty keeper of the book on knowledge . Contact me to get your copy .
|
|
|
|
|
if you meant this:
void CMyTab::OnNcPaint()
{
CDC *pDC = GetDC();
CRect cr;
GetClientRect(cr);
FrameRect(pDC->m_hDC, cr, ::GetSysColorBrush(COLOR_3DFACE));
ReleaseDC(pDC);
}
then, no. that's not it. the border is still there.
-c
Image tools: ThumbNailer, Bobber, TIFFAssembler
|
|
|
|
|
I'm looking for a way to change the IP address of my computer through an application and testing to make sure there is no network conflict, ect. Can anyone point me to a good resource to figure this out? Thanks
|
|
|
|
|
Are you asking how to change it programatically, or are you just wanting to change the ip?
You can use ipconfig from the command line to change network settings pretty quickly, but I am not sure if that is what you are asking for.
Could you clarify what you want to do please?
- Dana
|
|
|
|
|
How do I check for leaked GDI objects?
|
|
|
|
|
They don't leak in W2000/XP. In W 95/98/ME, you'll find you suddenly can't draw any thing, nor can the system. MSDN mag ran a tool that showed the number of resources used and allowed you to browse them, a couple of years ago I think.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
They leak every where, but WinNT/Win2000,WinXP system are use 32bit vales for addressing up to 2^32 GDI objects while 9x system uses just 16bit values, thus can hold only 2^16, which is much fewer. However that does not mean you can use the whole 4 billion GDI objects in WinNT systems, still the system put an upper limit but I do not know it exaclty, but I did encounter resource leak in WinXP before.
check this MSDN article
http://msdn.microsoft.com/msdnmag/issues/01/03/leaks/default.aspx
Anyway, to detect resource leaks in Win2000/WinXP just open the task manger and go to the processes tab, then from from the "View" menu choose "Select Columns..." the check "GDI Objects". After that look up your process from the system processes and monitor its GDI Object, if they constantly increase then you have a leak, if it increase then stop increasing then it could just be initial allocations.
|
|
|
|
|
Here my special problem:
I have a class CBauteil (derived from CObject) and an CObArray.
CBauteil has although Array with an CObject Class (CBauteilschicht).
exp.
class CDoc : public CDocument
{
public:
CObArray m_oaBauteil;
...}
_________________________________________________
class CBauteil : public CObject
{
public:
CObArray m_oaBauteilSchicht;
...}
_________________________________________________
//Acces to first (filled) array
CBauteil *pBauteil = (CBauteil*) pDoc->m_oaBauteil[0];
//Pointer to second ObArray (m_oaBauteilschicht)
pBauteil->m_oaBauteilschicht
//Now I add a new entry to the first Array
CBauteil *pNeuBauteil = new CBauteil();
pDoc->m_oaBauteil.Add(pNeuBauteil );
//and now I want to copy the first Entry of the "SubArray"
pNewBauteil->m_oaBauteilSchicht.Copy(pBauteil->m_oaBauteilschicht);
The Problem:
When I change a value in the original Array m_oaBauteilSchicht[0] the value in m_oaBauteilSchicht[1] changes although. How can I get a real copy so that I can change the values seperately?
|
|
|
|
|
AnTri wrote:
can I get a real copy so that I can change the values seperately?
allocate a new CBauteil object. copy the data from your 'source' object. add the new object to the second array.
-c
When history comes, it always takes you by surprise.
|
|
|
|
|
Hello,
I have a VC++6(MFC) Application which is giving me a problem in Windows98/ME, but not on XP or 2000. The App has a CView that I use to draw on the screen OnDraw(CDC* pDC). I read information for an access database using ado and from that information I draw a chart on the screen. It runs five on XP/2000 but on 98 after a while or many call to the OnDraw functions it freezes and all the bitmaps that I am drawing on the screen don’t show anymore when I try to open a dlg it show a message box saying “A required resource was”.
Any help will be appreciated.
Thank You,
Alfred
|
|
|
|
|
the first thing you need to do is to check for leaked GDI objects.
-c
When history comes, it always takes you by surprise.
|
|
|
|
|
I have a dialog that owns a tree control.
I want to catch a middle button down message in the dialog class.
How can I do this ?
I can catch the message in the tree control but I don't want this.
Does anyone have an idea what can I do about this problem.
Thanks
Orcun Colak
|
|
|
|
|
This should work.. Handle the PreTranslateMessage() Function in your dialog..
BOOL CMyDlg::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message == WM_MBUTTONDOWN)
AfxMessageBox("Middle Button Pressed");
return CDialog::PreTranslateMessage(pMsg);
}
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Hio! I am working on a function that searches a huge text file (28000+ lines) for one line of text.. currently i am reading through every single line to find the number im lookin for.. and reading/loading the file currently takes about 25-30 seconds on a 500mhz..
how can i buffer the whole file faster? notepad only takes a half second to open the file, how can i do that? is there any way to jump to a specific line in a text file such that i can start halfway and go up or down if the number im looking for is higher or lower (the numbers are in order, but not sequential)?
here is what i have now, obviously the line by line approach wont work to well
while (!inFile.eof())
{
WndProgress.StepIt();
WndProgress.PeekAndPump();
if (WndProgress.Cancelled()) {
AfxMessageBox("Progress Error!");
WndProgress.DestroyWindow();
return FALSE;
}
inFile.getline(szBuffer2, sizeof(szBuffer2)-1);
strTemp = szBuffer2;
if (strTemp.Left(1) != ".")
{
CNumberAndName* pEntry = new CNumberAndName();
pEntry->m_strRoutingNumber = strTemp.Left(9);
pEntry->m_strBankName = strTemp.Mid(11,36);
paBankArray->Add(pEntry);
}
}
also, is there any easy way to tell how many lines long the file is?
thanks a bunch for any suggestions!
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
I suspect that Notepad is in fact opening the file as a memory mapped file, i.e. the file exists as if it was in memory, but it's on disk.
If you're reading with iostreams, you can do a seek to a point to start reading from, but in characters, not lines. The only way to speed up a search is to build an index.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|