|
i always thought
system("del file.txt")
was efficient.
*.*
cin >> knowledge;
|
|
|
|
|
int unlink(const char*) works too
todo....
:: insert inpirational text here ::
|
|
|
|
|
the typical newbie... they always want to code things much too difficult for them... i know that feeling...
Don't try it, just do it!
|
|
|
|
|
I tried to add this following function to a class in my project:
void SetPen(COLORREF penColor=0x00000000, UINT penStyle=PS_SOLID, int penWidth=0);
Adding this by hand gives no problem, except that the workspace window is bugged... trying to get to the definition in the .cpp file doesn't work.
The project will compile ok though, because the function really is there.
Now, if you add it using the workspace menu, a warning will appear that declaration en definition are not identical, and a corrupted definition is placed in the .cpp file....
void CMyClass::SetPen(COLORREF penColor);
This will NOT compile ofcourse...
It's easily fixed, replace UINT with unsigned int , but any typedef similar to the UINT one will show this behaviour.. (I'm using Visual Studio 6.0 SP5)
Anyone know a more permanent solution to this annoyance?
I wonder when Microsoft is held liable for damages due to their shoddy work...
|
|
|
|
|
I don't know any solution, but such problems force me to not use the ClassView tools, and instead resort to manual coding. I have always considered it a bonus if I happen to click on a function declaration in ClassView and it takes me directly to the definition.
Originally for sometime, I thought that it was me messing up, but found that it weren't. I now know that included the struct or defintiion longhand in the header file, and the typedefs can be used without problem in the declaration code bodies.
I too use SP5 but the same happened on SP3 too.
Sorry I can't be any help
|
|
|
|
|
I am new in windows programming and want to know, how to create bitmapped command button in Win32 API in detail.
|
|
|
|
|
Its very puzzling. I have a slider that controls the brightness of the image. The algorithm that does this is fine. The problem is that while I have the mouse pressed down on the slider, the image performs fine, following the slider nPos. But as soon as I let the mouse go, the image turns black. Some time ago I implemented the same thing in my MDI view class with the slider in the toolbar. That works fine. I cant see that I did anything different except that the slider then was in the same class (view) as the function being run in OnHScroll). But now I have a Cdialog instead with the slider, and its OnHScroll triggers the parent Cdialog to run the image brightening algorithm. The code in the slider CDialog is:
void CDlgSettings::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
pSld = (CSliderCtrl*)pScrollBar;
if (pSld !=0)
{
if(*pSld == m_sliderBright)
{
m_pParentWnd->SetBrightness(nPos);
}
if(*pSld == m_sliderContrast)
{
m_pParentWnd->SetContrast(nPos);
}
m_pParentWnd->DisplayLocal();
}
CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
}
The displayLocal merely refreshes the display with the newly brightened palette.
As long as the mouse is held down on the slider, the image shows correctly. Soon as I let up, it goes dark.
Thanks for the help,
ns
|
|
|
|
|
nPos is only valid if nSBCode is SB_THUMBPOSITION or SB_THUMBTRACK. when you let up the mouse, you get a WM_HSCROLL message with nSBCode set to SB_ENDSCROLL and nPos set to zero. You will probably get the same result if you just click on the slider's track bar.
The key is to use CSliderCtrl::GetPos() to get the current position, and simply ignore nPos.
m_pParentWnd->SetBrightness(pSld->GetPos());
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Hi all,
Any Ideas how can i get access to IHTMLParamElement Interface... I have inserted an ActiveX control in MSHTML... i got IHTLMObjectElement interface pointer.. but now i need to change the properies of this ActiveX control at run time..
I have tried it via DOM. I get IHTMLDOMNode for ActiveX but i can't seem to have access to childNodes. It seems <object> tag doesn't support child nodes...
any ideas are welcome.. even a hint will do
cheers
|
|
|
|
|
Why can't you just directly set property of an ActiveX control through script or otherwise without messing with HTML?...
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
Hi!
I am trying to use the STL with eVC4... and I have the following linking error:
error LNK2001: unresolved external symbol "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ)
Any idea anyone? Thanks!
|
|
|
|
|
Hi
Is there any STL container like vector, set etc. that allows only unique items to be inserted into the list? Somewhat like that:
std::vector<string> arrayNames;
arrayNames.push_back("John");
arrayNames.push_back("Robert");
arrayNames.push_back("Luis");
arrayNames.push_back("John");
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
You named one already....a 'set' will only hold unique values....the value you add is immediately it's key.
Er zit een korstje op mijn aars.
|
|
|
|
|
|
I am building a search engine desktop application. It works by putting in text in an Edit control then hitting the search button and let it search the entire internet looking for web pages with the occurences of my search text on them.
Ok the question is, how do i determine which web site the Application should start the search at without specifically specifying a web site.
Any ideas out there??
void signature(){
cout<<"Sobbayi Interactive"<
|
|
|
|
|
|
Are you implying a random web-search? In an socket applicant, a process can bind a TCP/IP socket to one connection. You cannot search multiple servers without creating more sockets.
Kuphryn
|
|
|
|
|
Hello!
I am copying a binary file like a document or some other maybe not-text file to a IStream.
I think IStream must use the Write() method to copy data but I must copy from my source one character at a time using fgetc(). I decide to create a char buffer of abitrary size of 80 chars and then fill buffer up to max size each time before I write to IStream.
I do not know if this is the best bufsize.
Does the bufsize matter?
How can I work out a better size for buf?
Can I add one char at one time to IStream?
Thank you.
|
|
|
|
|
Yes.
Bigger is better.
Yes but don't.
If you are also opening the FILE* yourself, there might be lots of better ways to do this, like memory-mapping the file and writing in page-sized chunks.
Steve S
|
|
|
|
|
I'm using the SetNameOf function to rename a folder relative to its parent folder.
The Renaming works well but the pidl I get back is not the one I expect.
When I rename C:\Foo\Bar to C:\Foo\Bar.temp
the pidl I get back corresponds to C:\Documents and Settings\Arjan\Desktop\Bar.temp
<br />
LPCOLESTR lpNewName = A2OLE(GetItemText(m_hLockedItem));<br />
LPITEMIDLIST pidlNew;<br />
<br />
HRESULT hr = pParentFolder->SetNameOf(AfxGetMainWnd()->GetSafeHwnd(),<br />
pidlRel,<br />
lpNewName,<br />
SHGDN_INFOLDER,<br />
&pidlNew);<br />
<br />
CString s;<br />
SHGetPathFromIDList(pidlNew, s.GetBuffer(MAX_PATH));<br />
s.ReleaseBuffer();
What am I doing wrong here?
Thanks,
Arjan.
|
|
|
|
|
Hi,
I need to install the SOAP client software, and not to install the whole Soap Toolkit. I have found an Soap_core.msm and a Isapi_files.msm, the problem is that I cannot use that files in my installer .
Is there any way to install the dll's manually ? ( without screw up XP or 98... ).
Greetings
Braulio
|
|
|
|
|
Hello, everyone!
I am writing a FTP client and I do not want to write the program from scratch. I want to know whether there are some free and open source FTP library that I can use to build my FTP client program quickly? For example, the library provides functions that can be used directly to upload a file, or connect to specified site.
Better the FTP library is based on standard C/C++ and not based on MFC.
regards,
Geo
|
|
|
|
|
Type ftp into the Search box up above and you'll find several ftp clients here on CP.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Thanks, Neville buddy!
I find they are all written in C# or based on MFC classes. Are there some FTP client library that is written in stardard C/C++ and not based on MFC? I want the library easy to port on different platforms.
regards,
Geo
|
|
|
|
|
Libwww contains FTP client code.
|
|
|
|