|
led mike wrote: I would be about 99.9999999999999999999999999999999 %
I am 100% percent sure the leak is in his code.
|
|
|
|
|
CoffeeAddict19 wrote: Detected memory leaks!
Dumping objects ->
{299} normal block at 0x010A65A8, 152 bytes long.
Data: 48 EC 57 00 CD CD CD CD 32 30 30 33 31 30 00 CD
{298} normal block at 0x010A64D0, 152 bytes long.
Data: << W 200310 > 3C EC 57 00 CD CD CD CD 32 30 30 33 31 30 00 CD
{297} normal block at 0x010A63F8, 152 bytes long.
Data: < W 200310 > E4 EB 57 00 CD CD CD CD 32 30 30 33 31 30 00 CD
{296} normal block at 0x010A6320, 152 bytes long.
Data: < W 200310 > F8 EB 57 00 CD CD CD CD 32 30 30 33 31 30 00 CD
{295} normal block at 0x010A6248, 152 bytes long.The program '[2212] CS_Project.exe: Native' has exited with code 0 (0x0).
You can go to memory leak source, by double clicking these lines.
|
|
|
|
|
Hello,
I am new to VC++. I am supposed to build an application which includes generating reports dynamically using data in a database based on what the user selects. i have heard of something called as Crystal Report.
But I am not sure whether that is the right tool to use because I dont know much about that software. Is this the simplest solution to generating reports. Is it possible to do the same without using additional software? Which are the other options, if any?I am using Visual C++ 6.0. Crystal reports is not bundled into it.
Kindly help
|
|
|
|
|
Well, Crystal reports surely beats building reports by hand. I have used it for 10 years. It does the job fairly well and can produce decent looking or even spectacual reports with niceties like drill-down, graphs and stuff.
It is not expensive either. Downside is that documentation is sorely lacking especially for C++. They seem to think everyone is using VB
See:
http://technicalsupport.businessobjects.com/KanisaSupportSite/supportcentral/supportcentral.do?id=m1
|
|
|
|
|
Thank you so much for your reply.
Anders Gustafsson wrote: Downside is that documentation is sorely lacking especially for C++.
In what way is it lacking for visual c++. Is it farily straightforward to use....Because i am really hard pressed for time on this project. Are ther some tutorials for that?
Also, I have heard about a software called Visual reports from sparrow-technologies. How does this compare in terms of ease of usage and display properties. Also, this maybe wandering away from the topic a bit, but could you please recommmend some good tutorials for VC++ 6.
I am building a Gui for a database application.
Thank you again.
|
|
|
|
|
I cannot really compare it to anything else. When we decided to convert our payroll app to C++ in 1997, Crystal was pretty much the only game in town. It is also quite widely used. It has a nice GUI editor where you create report files by pulling data from a database source. The finished report is an .rpt file that you distribute and use the CR engine to display/print.
I suggest you download rdccpp85.exe from the BusinessObjects site. It has an example on how to call a report from C++. It lacks examples on how to pass an argument to it though, but ask if you need it
Also. I have two books on Cr9 on the shelf. Both are OK. One is Mastering Crystal Reports 9 from Sybex, the other is Crystal Reports Essential by Jill K Howe from Premier Press. Both are avalable from Amazon.
I had a quick chec at the Visual Reports site. It seems similar. I also see that there is an eval version you can download. for us, we stick with CR despite it's quirks. We are taking about a commercial app here, with a lot of reports. So I would rather not have to recreate those. FWIW, we are licensed for CR version XI, but selected to use CR9 for now, "because that is what the bulk of the other vendors use"
Your selection will also depend on what fees if any are on redistribution. A crystal developer license allows pretty much unlimited distribution.
|
|
|
|
|
Hi
I have a server app that I'm developing. When I call the bind function that is in my BindStructOnSocket function, depending how I filled my sockaddr_in structure, occurs an different error.
If I fill my sockaddr_in.sin_addr field like this :
<br />
SocketStruct->sin_addr.s_addr = INADDR_ANY;<br />
When I call accept function my app enters in a infinite loop.
If I fill my sockaddr_in.sin_addr field like this :
<br />
char cName[30];<br />
gethostname(cName, 30);<br />
hostent * theHost;<br />
theHost = gethostbyname(cName);<br />
SocketStruct->sin_family = AF_INET;<br />
SocketStruct->sin_port = htons(2500);<br />
SocketStruct->sin_addr = *((in_addr*)theHost->h_addr_list);<br />
When I call accept I get the WSAEADDRNOTAVAIL error.
My queswtion is WHY?
I'm developing this with Visual C++ 6
Below my code
Tks for the support
<br />
SOCKET CreateSocket()<br />
{<br />
SOCKET theSocket;<br />
WORD wVersion = MAKEWORD(2, 0);<br />
WSADATA wsStartup;<br />
WSAStartup(wVersion, &wsStartup);<br />
theSocket = socket(AF_INET, SOCK_STREAM, 0);<br />
if(theSocket == INVALID_SOCKET)<br />
{<br />
MessageBox(NULL, "Socket não criado", "Erro", MB_ICONERROR|MB_OK);<br />
return INVALID_SOCKET;<br />
}<br />
return theSocket;<br />
}<br />
<br />
void CreateSocketStruct(sockaddr_in * SocketStruct)<br />
{<br />
SocketStruct->sin_family = AF_INET;<br />
SocketStruct->sin_port = htons(2500);<br />
SocketStruct->sin_addr.s_addr = INADDR_ANY;<br />
for(int i = 0 ; i < 8 ; i++) SocketStruct->sin_zero[i] = 0;<br />
char * cTemp;<br />
cTemp = inet_ntoa(SocketStruct->sin_addr);<br />
MessageBox(NULL, cTemp, "", MB_OK);<br />
}<br />
<br />
int BindStructOnSocket(SOCKET currSocket, sockaddr_in * SocketInfo)<br />
{<br />
int iTemp = bind(currSocket, (sockaddr*)SocketInfo, sizeof(sockaddr));<br />
if(iTemp != 0)<br />
{<br />
int i = WSAGetLastError();<br />
char cTemp[5];<br />
if(i == WSAEADDRNOTAVAIL)MessageBox(NULL, "", "Erro", MB_OK);<br />
}<br />
return iTemp;<br />
}<br />
|
|
|
|
|
The second method won't work if there's no adapter associated with the address you specify.
The first method (using INADDR_ANY) should be correct. There's maybe something wrong with your
accept processing.
Is this the server's listening socket you are using the above code on?
Mark
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
Mark Salsbery wrote: Is this the server's listening socket you are using the above code on?
Exactly, I'm testing this code in my house but the problem persists
|
|
|
|
|
So once your listening socket is bound and listening, there's an infinite loop on accept?
Do you mean it just sits (blocked) in the accept() call?
Assuming your socket(), bind(), and listen() calls all succeed (no errors) then this is the
correct behavior for a blocking socket when you call accept(). accept() will block until there's
a connect request.
Mark
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
No, there aren't an infinite loop on accept. And yeah, it just sits in the accept call.
|
|
|
|
|
Then it is working as written.
I'm guessing you need that to be asynchronous instead of halting the thread, correct?
If so, you can do one of these:
1) Leave the listener socket in blocking mode and put the accept call in a different thread.
2) Use WSAAsyncSelect() to place the socket in non-blocking mode and get a window message when
a connection attempt is received. Then call accept() in response.
3) Use WSAEventSelect() to place the socket in non-blocking mode and have an event signalled when
a connection attempt is received. Then call accept() in response (also requires a separate thread
to be effective).
4) Use an IO Completion Port (advanced).
*edit* Fixed some typnig.
Mark
-- modified at 17:33 Thursday 1st March, 2007
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
5) Buy your Fish Filet at McDonalds
led mike
|
|
|
|
|
Indeed! Dammit now I'm hungry.
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
Where Name is a BSTR:
TRACE("\nFIELD[%d]: %s",j,(LPCTSTR)Name);
or
TRACE("\nFIELD[%d]: %s",j,Name);
Both just print the first char??
Anders G
|
|
|
|
|
i think this will do it: TRACE("%S", myBeaster);
|
|
|
|
|
It did! Thanks!! This basic stuff is slowly polluting our pure C++ world
|
|
|
|
|
a BSTR is a UTF-16 (or is it UCS2? can't remember) encoded string. This means that each character is a 2 byte word. The ASCII character set fits within a single byte of each word. As such, from a char* point of view, a BSTR is basically a string with a \0 character between every character. Hence you get only the first character.
|
|
|
|
|
%S will work as long as you are calling an ANSI trace function. %S means "a string in the character set opposite of the current TCHAR character set". To make it work in all cases, use %ls instead.
|
|
|
|
|
Anders Gustafsson wrote: Where Name is a BSTR:
TRACE("\nFIELD[%d]: %s",j,(LPCTSTR)Name);
TRACE("\nFIELD[%d]: %s",j,(LPCTSTR)_bstr_t(Name));
|
|
|
|
|
Hi All.
Can anyone tell me how to change a text in an edit box of an other process programmatically (maybe using SetWindowsHook or something else) I want it to work on Win9x and WinXP
thanks
|
|
|
|
|
SendMessage(....)
led mike
|
|
|
|
|
See if its helpfuls
char *MY="Hello";
HWND hWnd = ::FindWindow("Notepad", NULL);
CWnd *hWndEdit=FindWindowEx(hWnd,NULL,"Edit",NULL);
::SendMessage(hWndEdit->m_hWnd,WM_SETTEXT,0,(long)MY);
|
|
|
|
|
// CEdit m_edit;
m_edit.SetWindowText ("your text");
|
|
|
|
|
He said on the other program not his program
|
|
|
|