|
hi
is there a way to copy a file to the same directory and renaming the file all in one. I've tried CFile::Copy, then rename, then copy again, but it seems a bit clumsy...
Thanks
|
|
|
|
|
Adrian2 wrote:
is there a way to copy a file to the same directory and renaming the file all in one. I've tried CFile::Copy, then rename, then copy again, but it seems a bit clumsy...
What exactly do you want to accomplish? Say you have a folder :- c:\abc. Now say you have a file one.gif. You want to copy c:\abc\one.gif to c:abc\two.gif and then rename one.gif to something else??? Is that what you want to do? If so, copy abc.gif to one.gif. Now rename abc.gif to whatever.gif! Pardon me if I misinterpreted your requirement.
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
jip
c:\file1.txt must become c:file2.txt
|
|
|
|
|
|
Or use ShFileOperation, which I think let you move/copy files when they are open.
|
|
|
|
|
I'm preparing to develop a web stress testing software.Could someone give me some advices, such as how to realistically reproduce multiple
browsers requesting pages from a web application, what technologies should we adopt...
Our software is aiming to realize three main fonctions:
1. simulate a request to the web server, and trace the process, in order to see if the web
application works normally. If there is a problem, we could know where is it. web server?
database? etc
2. automatize the test, that means to set the test automatically executed in a fix time.
3. simulate multiple users send the request to a website simultaneously, to verify if the web
application works properly under a given enough great number of users.
Thanks a lots!
rick
LOVE LING
|
|
|
|
|
ricklau wrote:
3. simulate multiple users send the request to a website simultaneously, to verify if the web
application works properly under a given enough great number of users.
This can be done using multiple threads. Start n threads and get them all to attack a particular portion of the web site at the same time.
ricklau wrote:
2. automatize the test, that means to set the test automatically executed in a fix time.
You can either feed in a predefined set of URLs. Or you can parse the URLs in a web page and go to each of them automatically. And you'd also have to populate the form text and other fields with random data (sounds rather like a lot of work to me).
ricklau wrote:
1. simulate a request to the web server, and trace the process, in order to see if the web
application works normally. If there is a problem, we could know where is it. web server?
database? etc
I doubt if you can locate the error precisely. It might be a db error but the error might be due to buggy server side scripting.
Regards,
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
|
Hi there,
I want to capture screenshot as well as keystrokes pressed in DOS mode. I have worked on Windows API for achieving these results. It is working fine in case of windows application. I just want to know why it is not happening in DOS promp mode. Is there anyway to achieve this.
I need expert guidance from all of you before reaching any conclusion on this part.
Thanks in advance,
Shitij.
|
|
|
|
|
Hi there,
I want to capture text and password field for an active window. Is there anyway to achieve this.
Thanks in advance,
Shitij.
|
|
|
|
|
|
You probably didn't googled before posting.
MS free stress tools[^]
http://webtool.rte.microsoft.com/comparison.htm
http://www.paessler.com/WebStress/webstress.htm
...
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
I just write this code in my initdialog of my dialogbox.so whenever i open this code,the memory size is increased.iam writing this code in win32application.Not an MFC Code.What might be the reason for memory leak above.
IXMLDOMDocument* pXMLDoc=NULL;
IXMLDOMNamedNodeMap* pXMLNamedNodeMap=NULL;
IXMLDOMNodeList* pXMLNodeList=NULL;
IXMLDOMNode* pXMLAttNode=NULL;
IXMLDOMNode* pXMLNode=NULL;
HRESULT hr;
CComBSTR bstrName;
CComVariant varValue;
CComVariant varNodeValue;
long lCount;
VARIANT_BOOL bIsSuccessful;
hr = CoInitialize(NULL);
hr = CoCreateInstance(CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER,
IID_IXMLDOMDocument, (void**)&pXMLDoc);
if (FAILED(hr))
return(hr);
if(hr)
{
pXMLDoc=NULL;
pXMLDoc->Release();
}
CoUninitialize();
|
|
|
|
|
suresh_sathya wrote:
pXMLDoc=NULL;
pXMLDoc->Release();
This does not only produces a memory leak, it also does a very nice GPF! since you are using a null pointer to call Release().
So, first of all, pXMLDoc->Release() must be called before pXMLDoc=NULL;
Otherwise, it does not make much sense to use raw interfaces here, just use CComPtr<IXMLDOMDocument> pXMLDoc; instead. It will even release the object for you.
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
I am just trying to parse xml and add some attribute names to my listbox.But when the program comes in for loop,it stops at third line and shows memory error.
Debug assertion failed
CComPtr<ixmldomdocument> pXMLDoc;
CComPtr <ixmldomnamednodemap> pXMLNamedNodeMap=NULL;
CComPtr <ixmldomnodelist> pXMLNodeList=NULL;
CComPtr <ixmldomnode> pXMLAttNode=NULL;
CComPtr <ixmldomnode> pXMLNode=NULL;
HRESULT hr;
CComBSTR bstrName;
CComVariant varValue;
CComVariant varNodeValue;
long lCount;
VARIANT_BOOL bIsSuccessful;
hr = CoInitialize(NULL);
hr = CoCreateInstance(CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER,
IID_IXMLDOMDocument, (void**)&pXMLDoc);
if (FAILED(hr))
return(hr);
varValue="testing.xml";
hr=pXMLDoc->load(varValue,&bIsSuccessful);
pXMLDoc->selectNodes((_bstr_t)"DATABASE/TABLE[@Left]",&pXMLNodeList);
long Tablelen;
pXMLNodeList->get_length(&Tablelen);
HWND hListBox=GetDlgItem(hDlg,IDC_LIST);
CComVariant Tablename;
for(int ii=0;ii< Tablelen;ii++)
{
pXMLNodeList->get_item(ii,&pXMLNode);
pXMLNode->get_attributes(&pXMLNamedNodeMap);
pXMLNamedNodeMap->getNamedItem((_bstr_t)"Name",&pXMLNode);
pXMLNode->get_nodeValue(&Tablename);
//SendMessage(hListBox,LB_ADDSTRING,0,(LPARAM)(char *)(_bstr_t)Tablename);
}
|
|
|
|
|
There are many errors in this code. The best option is you get your hands on a working msxml sample first (download msxml 3 SDK, or msxml4 SDK, or platform SDK core services).
For instance, this article [^]on codeproject does such things.
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
I wanted to display 10 bitmaps using CImageList
but why all the bitmaps were black
1.first ,I created a project "Cards",Imported 1,2,...,10
2.and I added variable in CCardsView
CImageList* m_pImageList
and the function
BOOL CCardsView::AddBitmap(UINT nResourceID)
{
CBitmap m_bmp;
if(m_bmp.LoadBitmap(nResourceID))
{
m_pImageList->Add(&m_bmp,RGB(256,256,256));
m_bmp.DeleteObject();
return TRUE;
}
return FALSE;
}
3.CCardsView::CCardsView()
{
// TODO: add construction code here
m_pImageList=new CImageList;
m_pImageList->Create(71,96,ILC_COLORDDB,256,1);
for(int i=1;i<11;i++)
{
AddBitmap(i);
}
}
4.CCardsView::~CCardsView()
{
if(m_pImageList!=NULL)
{
delete m_pImageList;
}
}
5.void CCardsView::OnDraw(CDC* pDC)
{
CCardsDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
CPoint pos(0,0);
// m_pImageList->SetBkColor(CLR_NONE);
// m_pImageList->SetOverlayImage(0,1);
for(int i=0;i<10;i++)
{
m_pImageList->Draw(pDC,i,pos,ILD_NORMAL);
pos.x+=50;
}
}
Why?
--oly--
|
|
|
|
|
RGB(256,256,256) is like RGB(0,0,0). Max channel value is 255.
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
hi,
this is the debug result:
f:\projects center\task history\mission 8_13\hydrosrv\debug\msado15.tlh(409) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
and this is the source of warning:
enum RecordCreateOptionsEnum
{
adCreateCollection = 8192,
adCreateStructDoc = -2147483648,
adCreateNonCollection = 0,
adOpenIfExists = 33554432,
adCreateOverwrite = 67108864,
adFailIfNotExists = -1
};
tell me how to fix this problem.
Thanks in advance
Extreme programming. Do the No.1
|
|
|
|
|
adCreateStructDoc = 0x80000000
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
Hi
I have some dll set which I'm using in VC7. As long as it was compiled in VC7 everything was fine. Now, when I'm using the same dlls compiled in VC6, my program crashes when I'm trying to execute some code from this dlls. Is this a problem of using import libraries (lib files) from VC6 (I mean that maybe lib files from VC6 cannot be used in VC7), or maybe whole dlls are incompatible (this would be very stupid I think), or maybe this dlls are just buggy(and previous dlls compiled in VC7 are not buggy). If this is a problem of lib files is there a way to convert lib from VC6 to VC7 (I can't recompile this dlls). I know one "easy" solution to my problem: getting back to VC6, but of course it's not a good idea (probably I used some VC7 features and because program is quite big there would be a lot of work to do, additionally I just got used to VC7 and I like it ). Anyone have some hints? Thanks in advance
Mariusz Popiolek
|
|
|
|
|
Hi,
I've written a code which replaces characters in a string with their respective URLEncode (i.e a " " will be replaced by "+" etc..).
However the code crashes at execution.
Please help!!
Here's the code extract;
Code:
>-----------------------------------------------------------------------------
for(j=0;j
|
|
|
|
|
|
for(j=0;j<one.length();j++)
{
indxD = one.find_first_of ( " " , 0 );
one.replace(indxD,1,"%2B",3);
}
From the problem I see, you should escape % and replace it to %%2B, while the length is still 3. (Escaping escape code, weird that!).
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
In addition, your encode routine is completely wrong. Spaces should be replaced with +, while non alphabetical characters should be replaced with their hex ascii representation prefixed with a %.
That's not exactly what you are doing.
It's also questionable because whether you are using javascript (escapeurl), ASP (urlencode), C++ (InternetCanonicalizeUrl, UrlEscape), .NET (HttpUtility.UrlEncode), you've many SAFE ways to do it already. Why reinvent that f***ing squared wheel ?
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|