|
Is there anyone who can help me with this question??
Life is hard.
|
|
|
|
|
Atony Chen wrote: Is there anyone who can help me with this question??
Try Google or MSDN newsgroups
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
1.a Solution had project A and project B,
they are must use a.cpp and a.h,
where the a.cpp and a.h place that is good.
2.and one project use some character string,
define them in a same file, is it good?
and how can i rename this file ?
3.same as question 1, and a.cpp and a.h write some usual function, how can i rename it? Function.h and Function.cpp?
Thank u.
|
|
|
|
|
Usually, when one or more projects share files like that, then I place the 'shared' files in a folder SEPARATE frome other project, such as a 'Common' folder, and then reference the 'Common' folder for header file inclusion. The viusual studio lets you 'add' the files to the project. You can add the files from the 'Common' folder to each project tha needs them.
The reason to keep them separate is so that when the 'common' files reference a 'non-shared' header file like stdafx.h, they will see the correct header file from the respective project.
Otherwise, your two easy options are a statically linked library (LIB) or a dynamically linked library (DLL). These project would include the same code, theoretically, when used from one project to another.
Now, one reason I don't always go the LIB or DLL route is so that the 'shared' files take on the characteristics of their respctive project - UNICODE, multithreading, exception handling, etc. which can sometimes cause issues when you use a LIB or DLL built differently from your current project's settings.
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
Hello,
I have an FTPServer application developed using CAysncSocket, which
is running quite well from the past 4 years.
I have added OpenSSL support to this application recently.
This is how my application works exactly.
1)A connection is established with the server app from a client.
2)Once the connection (command socket) is established, a thread is
created and the socket is transferred into the thread.
3)Then a set of commands are transferred between the client and the
server (My app)
4)Then another socket is created, (data socket), in which the actual
data file is tansferred.
5)The connection for both the sockets are established successfully.
The SSL handshake also happens correctly.
When I am trying to transfer the file in the data socket in encyption mode using SSL, a portion of the data is transferred successfully (received by the server app) and socket is timedout aborting the data transfer.
When I have debugged the application I have found that
MySocket::OnReceive() is not getting called, where I have put a breakpoint.
Note: SSL connection for each socket is exists.
Can any one please help why this is happening or how I can make the
OnReceive() fn get called so that my data is transferred completely.
Thanks in Advance.
Seetharam
nsrsetty@yahoo.com
|
|
|
|
|
Hi guys,
I want to call ASP page from vc++. I'm using CInternetSession, CHttpConnection classes (POST method). Form values are send thr URL. I can't get the
form values in the ASP pages that I send thru URL.
Just quick will do be great.
Thank n regards
vivek.s
vivek.s
|
|
|
|
|
Dear Vivek ,
if u are using POST method then u cannot send any type of values thr URL
[ie "httt://www.mypage.asp?val1=hello"] . if u want to send data through GET method then only it is usefull. But using GET method u cannot send more size Data. So u need to send data using CHttp.Send() API ...
Please let me if this works... , if not then can u provide me ur code snippet, so that i may help you out in that.
Thanks,
Jig
|
|
|
|
|
Dear jigneshrpatel ,
Thanks for ur quick reply. Ya I make an attempt thru
CHttpFile: SendRequest(). still not working.
code is!..
pStrVerb = POST;
pServer = session.GetHttpConnection(lpstrServer, usPort,
pstrUserName, pstrPassword);
pFile = pServer->OpenRequest(pstrVerb, strFile, pstrReferer);
CString strFile= "\mypage\getdata.asp ";
pFile = pServer->OpenRequest(pstrVerb, strFile, pstrReferer);
//,1, &pstrAcceptTypes, pstrVersion, dwHttpRequestFlags);
pFile->AddRequestHeaders(szHeaders);
pFile->AddRequestHeaders("User-Agent: GetWebFile/1.0\r\n", HTTP_ADDREQ_FLAG_ADD_IF_NEW);
CString CStrTempQueryString = _T("txtpname=Winrunner&txtptype=Testing");
pFile->SendRequest(NULL, 0,(LPVOID)(LPCTSTR)CStrTempQueryString,CStrTempQueryString.GetLength());
pFile->QueryInfoStatusCode(dwRet);
I want these data (txtpname=Winrunner&txtptype=Testing") in ASP page
Note:
I also change the code to
CString CStrTempQueryString = _T("?txtpname=Winrunner&txtptype=Testing"); still not working.
Kindly do it ASAP. Thanks for ur effort.
viveks
viveks
|
|
|
|
|
|
Hi,
my program is used to submit values to asp page using post method. but the submitted values are not received on the server. my script in given below. any one help me out.
pServer = session.GetHttpConnection(CStrDomain,nPort);
pFile = pServer->OpenRequest(CHttpConnection::HTTP_VERB_POST,CStrSuburl,Referer,1,NULL,"HTTP/1.0",dwHttpRequestFlags);
pFile->AddRequestHeaders(szHeaders);
pFile->SendRequest(NULL,0,(void*)(const char*)CStrTempQueryString.GetBuffer(CStrTempQueryString.GetLength()) ,CStrTempQueryString.GetLength());
urgent. Thanks in Advance.
Have A Nice Day!
Murali.M
|
|
|
|
|
I Find the solution. I think this one is useful to all. i found this on following url http://support.microsoft.com/kb/q165298/[^]
In many cases, the server does not respond appropriately if a Content-Type is not specified. For example, the Active Server Pages component of IIS 3.0 actually checks this header specifically for 'application/x-www-form- urlencoded' before adding form variables to the "Request.Form" object. This MIME/Content-Type indicates that the data of the request is a list of URL- encoded form variables. URL-encoding means that space character (ASCII 32) is encoded as '+', special character such '!' encoded in hexadecimal form as '%21'.
Here is a snippet of code that uses the MFC WinInet classes to simulate a Form POST request: CString strHeaders =
_T("Content-Type: application/x-www-form-urlencoded");
// URL-encoded form variables -
// name = "John Doe", userid = "hithere", other = "P&Q"
CString strFormData = _T("name=John+Doe&userid=hithere&other=P%26Q");
CInternetSession session;
CHttpConnection* pConnection =
session.GetHttpConnection(_T("ServerNameHere"));
CHttpFile* pFile =
pConnection->OpenRequest(CHttpConnection::HTTP_VERB_POST,
_T("FormActionHere"));
BOOL result = pFile->SendRequest(strHeaders,
(LPVOID)(LPCTSTR)strFormData, strFormData.GetLength());
Have A Nice Day!
Murali.M
|
|
|
|
|
Is it possible to get a snapshot of my window and copy a part of it to temporary image object, just like what Bitblt does?
How can I copy the content of a Graphics object to one another?
<font=sans-serif>|-|3llo Wo|2ld
|
|
|
|
|
Hi,
I have a large amount of data being passed from a hardware device into a safearray. I am using this safearray t communicate all that data to a VB ActiveX Control using a event to tell the container that data is ready, but when I call the function GetData is causes all of the program to freeze, is this a problem that safearray can not keep up or something?
This is the code I'm using to get the Data, is there anything wrong in it?
SAFEARRAYBOUND bound;
bound.cElements = 350000;
bound.lLbound = 0;
imageData->vt = VT_UI1 | VT_ARRAY;
imageData->parray = SafeArrayCreate( VT_UI1, 1, &bound );
void * pDest;
SafeArrayAccessData( imageData->parray, &pDest );
memcpy( pDest, &hwdData, 350000 );
SafeArrayUnaccessData( imageData->parray );
Because this data can come up to 150 Hz is there a faster way of doing this. or am I stuck with SafeArrays?
Thanks
|
|
|
|
|
A BSTR can hold a sequence of bytes (not just a Unicode C-style string, which is how it's most often used). There's no way to tell without doing some profiling whether a BSTR will be any improvement over a SAFEARRAY .
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
yup homework..
plz help....
|
|
|
|
|
|
jobits12 wrote: yup homework..
Hello Buddy,
if you really need help here, you have to do something by your own.. people here only help you where you facing problem tackling particular task not whole application!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
description
1 let an indivudual join the clu (write details to file)
2 update member ,contribution
3 view detail contribution of member
4 total amount of all contributions
5 search and display info about member
6 view pay day of the member..
thanks!!
|
|
|
|
|
Homework?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Solution
1. Design a application model using UML
2. You will need a database to store everything in (files aren't that safe)
Use MSDE its free
3. Install an IIS where youre application can run one
4. provide log in pages
5. provide overview and detail pages according the Use case you need (see 1. the application model)
6. Generate the code, compile and run it
No problem
codito ergo sum
|
|
|
|
|
jobits12 wrote: description
1 let an indivudual join the clu (write details to file)
2 update member ,contribution
3 view detail contribution of member
4 total amount of all contributions
5 search and display info about member
6 view pay day of the member..
thanks!!
HAve you tried something!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
jobits12 wrote: 6 view pay day of the member..
How about the "pay day" of the helper?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hi
I have some Debug and AccesViolation on teminating myThread.
My code looks like:
<br />
class MyAppView : public CScrollView<br />
{<br />
...<br />
CMax * mMax;
<br />
bool maxbreak;
<br />
CWinThread * maxID;
...<br />
};<br />
<br />
<br />
...<br />
UINT MaxThread(LPVOID pParam)<br />
{<br />
CMax* dlg = (CMax*)pParam;<br />
dlg->max();<br />
return 0;<br />
}<br />
<br />
...<br />
void MyAppView::MaxStart()<br />
{<br />
maxID = AfxBeginThread(MaxThread, mMax,<br />
THREAD_PRIORITY_IDLE ,0,CREATE_SUSPENDED);<br />
maxID->m_bAutoDelete=TRUE;<br />
maxID->ResumeThread();<br />
}<br />
<br />
...<br />
<br />
void MyAppView::OnKeyDown(UINT ..., UINT ..., UINT ...)<br />
{<br />
switch (nChar) <br />
{<br />
case VK_ESCAPE:<br />
if(!pauseMax)<br />
{<br />
maxbreak = TRUE;<br />
WaitForSingleObject(maxID,INFINITE);<br />
}<br />
break;<br />
}<br />
}<br />
<br />
<br />
...<br />
void CMax::max()<br />
{<br />
...<br />
if(p_View)<br />
{<br />
p_View->SendNotifyMessage(...);<br />
}<br />
while(... && !maxbreak)<br />
{<br />
...<br />
}<br />
if(p_View)<br />
{<br />
p_View->SendNotifyMessage(...);<br />
}<br />
...<br />
}<br />
<br />
I hope u understand what i mean otherwise pls ask.
I have 2 questions:
1. setting maxbreak = true ends prozessing imediatly but not the thread this takes a while to end up why and how to change ?
2. why does WaitForSingleObject(...) not wait for termination or how to explain the not working 'delete maxID';
THX
|
|
|
|
|
tbrake wrote: explain the not working 'delete maxID'
You've set m_bAutoDelete on the thread, so it is automatically deleted, and then that line is trying to delete it a second time.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi
Well equal if m_bAutoDelete = true or false calling delete maxID will last to an accessvalidation error.
And do you anything aout ending threads quick ??
THX
|
|
|
|
|