|
|
Muhammad Ahmed wrote:
to read memory outside the memory area allocated to my program.....
There really isn't a physical memory "allocated" to your program, every application has its own "virtual memory" in the operating system environment and some parts of this space may be in the physical memory while some may be on the pagefile. I think you should first read about the topic "virtual memory" before digging into kernel mode drivers or dos etc.
|
|
|
|
|
Hello,
I want to develop an application, which involves communicating with EPABX through PC, in such a way that I should be able to get all the details about phone calls made like call duration, etc.
Any help is highly appriciated.
Tushar Bhatt
|
|
|
|
|
I uses SGI STL in one of my project and it works very good in VS 6.0.
But when i compile it under VS2003 i get
d:\Projects\STL\sgi\stl_alloc.h(305) : fatal error C1001: INTERNAL COMPILER ERROR
Anyone know if there are any compiler setting I need to changed to be able to compile SGI STL with VS2003 ?
|
|
|
|
|
What are the best online C++ tutorials for experienced VB developers who need to learn C++ fast. In other words, they need one that is both clear and concise.
To put this in perspective, I have a friend who is a VB developer who's been thrown in at the deep end. This is what he said:
"My boss agreed to write a component for a company that wanted it as a small download. He incorrectly thought you didn't need the VB VM library (weighing in at 1.6 MB) and that we could do it in VB6.
So we'll have to do it in VC++ ver6. What he thought might take 3 days will now probably take 3 weeks - talk about a loss leader! I haven't got the first clue about VC++. I did a little C on UNIX back in my 2nd year ar Uni and placement year, but that was 13 years ago. I may need to pick your brains a little, concerning the MFC. Is it quite large ? Our component has to be under 1MB to download, so the client thought that would rule out using the MFC.
Basically, the component has no interface, it just needs to sit in the system tray and every hour interrogate a fixed URL to determine if there are any changes to the page. If so, the system tray icon should change colour and should a bubble with some text in it and then (when clicked on) open the browser and take the user to that page. It needs to store the URL and frequency with which to check it in an ini file or the registry.
We've got some code to handle the system tray icons and I've got some code to download a web page to a file, but then we need to parse the text for any changes. Not sure how they'll be determined yet. We're not sure what we'll need to do in terms of a setup and deployment package. Will everything needed be built into the .exe file or will it have dependencies on anything such as the MFC dll(s) ?"
I've suggested using ATL and, in fact, there's an example on Code Project that appears to do exactly what he wants.
I suppose the question is really: "How little C++ does he need to know to achieve his objective?"
I have extensive experience with MFC, but nothing in components. I've done a little ATL but not commercially.
Kevin
|
|
|
|
|
|
I was thinking of online tutorials really.
But could a VB developer who knows no C++ dive straight into this book?
Kevin
|
|
|
|
|
He/she could try . Seriously though, if I were you, I would not worry about C++ skill as much as understanding of COM/ATL. After all C++ in ATL is strait forward. I saw some VB guys learning bits of C++ pretty fast (6 months +), but making horrific mistakes in COM (like infamous in/out parameters allocation/deallocation).
As for online, "there could be only one";) - MSDN
|
|
|
|
|
I taught several experienced VB programmers how to code in Visual C++, and creating ATL components.
On average, they took about 3 months to start coding interesting things, and about 6 months to become good C++ programmers. Sure, they became much better VB programmers after that.
IMHO, 3 weeks for such a project, for people who have no experience at all on it, is a shoot on your own foot.
Kevin McFarlane wrote:
Will everything needed be built into the .exe file or will it have dependencies on anything such as the MFC dll(s) ?"
Yes, you can statically link MFC, the runtime and ATL, producing a standalone .EXE.
Kevin McFarlane wrote:
Is it quite large ? Our component has to be under 1MB to download, so the client thought that would rule out using the MFC.
I can make the world spin reversed in a 1MB MFC executable
If the application is as simple as you mentioned, a properly optimized project should be in the 200Kb~300Kb range, without depending on any runtime DLLs. Compressed, it becomes under 100Kb.
My latest article: GBVB - Converting VB.NET code to C#
|
|
|
|
|
Thanks. That's useful info.
Daniel Turini wrote:
IMHO, 3 weeks for such a project, for people who have no experience at all on it, is a shoot on your own foot.
I agree. He should blame his boss!
Kevin
|
|
|
|
|
hi,
i need to disable tray menu item form different dialog box.
can you help me?
|
|
|
|
|
What do you mean with "from a different dialog box"?
Just call EnableMenuItem(wndMyMenu, ID_MENUITEM, MF_DISABLED) ?
Rickard Andersson8
Here is my card, contact me later!
UIN: 50302279
E-Mail: nikado@pc.nu
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
BTW: You have to do this in WM_INITMENU
Rickard Andersson8
Here is my card, contact me later!
UIN: 50302279
E-Mail: nikado@pc.nu
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
Thank u Rickard.
Thank u very much for ur reply.
i already solved this problem.
|
|
|
|
|
hi,
can anyone tell me where to find some docuentation and/or examples on broadcast client/server communication in VC++?
thanx
|
|
|
|
|
Try Google?
Rickard Andersson8
Here is my card, contact me later!
UIN: 50302279
E-Mail: nikado@pc.nu
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
i've tryed but i found nothing about it...
|
|
|
|
|
3.8 - How do I send a broadcast packet?
With the UDP protocol you can send a packet so that all workstations on the network will see it. (TCP doesn't allow broadcasting.)
To send broadcast packets, you must first enable the SO_BROADCAST option with the setsockopt() function. Next you have to figure out the "directed broadcast" address, which means "send this packet to all stations on this LAN". To construct the directed broadcast address, use the following C code:
u_long host_addr = inet_addr("172.16.77.88"); // local IP addr
u_long net_mask = inet_addr("255.255.224.0"); // LAN netmask
u_long net_addr = host_addr & net_mask; // 172.16.64.0
u_long dir_bcast_addr = net_addr | (~net_mask); // 172.16.95.255
Potential Problems: Broadcasts can be useful at times, but keep in mind that this creates a load on all the machines on the network, even on machines that aren't listening for the packet. This is because the part of the stack that can reject the packet is several layers down. As a result, most routers drop simple broadcast packets, and sometimes even drop directed broadcasts to nearby networks. (A simple broadcast is one sent to address 255.255.255.255.) The practical upshot of this is that sometimes broadcasts won't work at all, and even when they do work they cause unnecessary loads on the network. To get around these problems, you may want to consider multicasting instead.
http://tangentsoft.net/wskfaq/intermediate.html#broadcast[^]
Rickard Andersson8
Here is my card, contact me later!
UIN: 50302279
E-Mail: nikado@pc.nu
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
i must use broadcast from project specifiation...
I use to routine to create Server socket:
As it is it runs wrong, i got an error calling listen, if i create a SOCK_STREAM instead of SOCK_DGRAM all goes well:
<br />
int passive_sock(int port, int qlen)<br />
{<br />
struct sockaddr_in sin;<br />
int s;<br />
int flag=1;<br />
int rv;<br />
<br />
memset((char *)&sin, 0, sizeof(sin));<br />
sin.sin_family = AF_INET;<br />
sin.sin_addr.s_addr =INADDR_ANY; <br />
sin.sin_port = htons(port);<br />
s = socket(AF_INET, SOCK_DGRAM, 0);<br />
rv=setsockopt(s,SOL_SOCKET,SO_BROADCAST,(char *)&flag,sizeof(flag));<br />
if (s<0) return -1;<br />
if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) return -2;<br />
<br />
if (listen(s, qlen) < 0){<br />
return -3;<br />
printf("listen error");<br />
}<br />
return s;<br />
}<br />
This is the client-side:
<br />
server.sin_family=AF_INET;<br />
server.sin_addr.s_addr=INADDR_BROADCAST;<br />
server.sin_port = htons(port);<br />
<br />
opt=(char *)malloc(10);<br />
strcpy(opt,"TRUE");<br />
conn_socket = socket(PF_INET,SOCK_DGRAM,0); <br />
retval=setsockopt(conn_socket,SOL_SOCKET,SO_BROADCAST,(char *)&flag,sizeof(flag));<br />
connect(conn_socket,(struct sockaddr*)&server,sizeof(server);<br />
i've noticed that if i change from SOCK_DGRAM to SOCK_STREAM setsockopt returns -1 (error)..
The main problem is that client sends packet.. i think (sendto returns 4)
but server doesn't receive nothing.. maybe server-side is wrong..ù
What do you think 'bout it??
|
|
|
|
|
I want to write a ActiveX Combo box support Unicode.
But when subclassing COMBOBOX, my Unicode ComboBox don't
display correctly. The standart combobox can not sizing in
Horizontal direction, but my Combo can.
Any one can tell me why??
My Unicode ComboBox is build using MFC ActiveX Control Wizard, subclassing COMBOBOX.
Thanks a lot.
|
|
|
|
|
Hi
Sometimes, i have a listview which has about 6000 records in it. It can take a while before showing the entire list.
Does anyone know how to display a label message or a message 'List is loading .. Please wait' while the list is loading. When the list is shown, message should disappear.
Anyone knows a good article about solving this problem.
Best regards
Jens
|
|
|
|
|
There is an article here on CP that displays a small progress bar while a tree is populated. That might be of use.
However you would be better off either trying to improve the load time or using a load on demand technique with a virtual list box. I don't know where your 6000 records are coming from but one would like to think that loading them should be almost instantaneous. Users don't like to wait!
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
So you are looking for a status dialog or such?
I am using Chris Maunders excellent status dialog:
http://www.codeproject.com/miscctrl/progresswnd.asp[^]
To update dialog controls while processing a big amount of data you should always call a function "Peek And Pump" which processes dialog messages (for example allows the user to click the cancel button of a dialog, without PeekAndPump all controls would be frozen and not reacting).
With this dialog you also can show how many items you have processed already. If you don't need the progress bar, just hide it. Shouldn't be that hard.
Btw, if you are processing such a large amount of data you should perhaps consider using a virtual list view which is MUCH faster than the normal Windows list view:
http://www.codeguru.com/listview/VirtualListControl.html[^]
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
yeah i'm currently looking at the 'virtual list view'. I hope i can use it too because i have about 6 columns & all text in the cells.
I see the trick is to move all data in an array, and then when windows asks the text, just check which position (subitem) we are talking about & retrieve it from the array.
But i think i need to read more of this to understand it better.
Thanks for the good article. I'm sure it will be usefull.
Greetings
Jens
|
|
|
|
|
I assume you've already tried CListCtrl::SetItemCount() ?
|
|
|
|
|