|
Control something - a radio control car, a homemade robot - it neddn't be too fancy. Build a model village and run the stoplights and house lighting with the computer. Write a crypto algorithm that people can type a message into and see what comes out, demonstrating secure website principles. Or you could always do the standard volcano, erupting all over a computer.;P
"Another day done - All targets met; all systems fully operational; all customers satisfied; all staff keen and well motivated; all pigs fed and ready to fly" - Jennie A.
|
|
|
|
|
In one of my science project a guy had build to control the lights and other stuff using computer program. But they were communicated by wireless system.
You need the knowledge of industrial electronics as well. This project won first price.
My God is more powerfull Than Your God. (the line that divides the world)
|
|
|
|
|
In our chemistry class back at school we did some sort of titation automate: reading the pH from a pH-meter, and using a computer controled syringe pump to set the pH to neutral.
But I must admit that it never really worked...
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Hello,
I've searched the code project but haven't found any samples for what I'm looking for.
What I'd like to do is have a frame containing a tree view on the left and a list view on the right (not a splitter window). Sounds simple, but I don't have a quick reference to sort out the CFrame's needs. Any pointers and references would be appreciated!
thanks!
JennyP
|
|
|
|
|
|
Hello. Not a split of the same view, but rather two different types of views.
Thanks!
JennyP
|
|
|
|
|
Sounds remarkably like the wizard-generated layout produced by VC++ when you select the "explorer style" option.
If you're thinking more of a tree with columns sorta thing, then do a search here - there are at least a couple of articles related to accomplishing that.
Shog9
---
You'd better turn back, before the frost sets in.
These desert nights are for weathered men,
The ones who've already given in...
|
|
|
|
|
Hi,
I´m developing an app that has a treeview on the left, a formview on the top right and CView or CRichEditView on the bottom right with splitter bars in between. The treeview selects different views for the right hand side views (they can be of any view type). The code I admit is not elegant but it works very nicely. I think I found an artice here that I based my code on. Take a look at the Splitter windows section under MFC Controls here on CodeProject.
best of luck to you,
Snorri
|
|
|
|
|
Its quite simple to do it, select the view as form view.
The form view is very much like a dialog, place the treectrl on the left and list view on the right,now you need to adjust the size of the treectrl and the list ctrl accrouding the percentage of the client area.
say 30% of x-axix to tree ctrl and 70% of x-axis to list ctrl and 100% of y-axis to both list and tree ctrl.
i hope i answered your question
Regards,
Prakash.
My God is more powerfull Than Your God. (the line that divides the world)
|
|
|
|
|
hello
Heres the generic situation ...
lets say i have a two machines connected via a socket and messages have been passing though all groovy like. Using send(theSocket etc etc
now, someone pulls out a cable
a Send from machine 1 will place the message in the queue for sending and send(theSocket... will report that it has done it's job.
How can i tell the socket/winsock to fail if the message didnt go through to the target right away?
i guess i'm asking how can i tell if a TCP message actually made its way across the network to the target PC.
Hmmmm
cheers
Bryce
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|
|
first of all let me suggest a good winsock book. Any socket book will do.
Okay...basically you have machine 1 that will listen for a connection to it. This is a server. Machine 2 is the client. The client creates a socket connection to the server which is listening for a client. When the cable is pulled between the two machines and the client tries to send to the server the socket returns back an error. What ever the last thing was that you were trying to send is what was not sent to the server.
Hope this helps.....but it might be better if you got a good book and read up on sockets... I afradi that I can't recommend one because I cna't name any off the top of my head, but there are two that I have in my office that are really good and if you want to email me I can emails back the titles and the authors.
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
well no the send( ) doesnt return an error when the client's cable is pulled out
on a network
the tcp message is queued and it tcp tries sending it again until it times out i suppose
I'll hafta think on this
bryce
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|
|
Not true. If the cable is disconnected, then the socket is dropped. If it is dropped on a Send then you will get back an error. You will probabaly get an error 10054
Tom
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
sorry tom old chap
network with N pc's
One running as a server and one as a client,
Do the socket connecty thing, fire a tcp message or two from the server
then you pull out the receiver's cable , the server's send(...) function will not necessarily return an error, it will return that it performed its job correctly (i know coz i just did it here at work )
from msdn
"The successful completion of a send does not indicate that the data was successfully delivered."
cheerypip
Bryce
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|
|
I would say, that in that case you would have to add your own ack/nak layer. You would have to have the receiver acknowledge every message you sent by sending back an "ack" message.
|
|
|
|
|
Hi,
How to get a coloured button?
Thanks,
Deepak Samuel.
|
|
|
|
|
Hi,
Your question has been posted several times! You should search the comments and you'll get your answer!
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
checkout for CxShadeButton class its a 'Class' of its own
|
|
|
|
|
Is there a way to convert the value of a string to an 'enum' value? For example:
string pos = "first";
enum ePOS {first, second, third, etc} POS;
POS = pos; OK, I know "first" as a string, is different than "first" as an 'enum' value (the 'enum' value being the equivalent of integer 0). But if the user enters "first" I'm trying to equate that to the 'enum' value "first" (without having to do a lot of "if - else" testing).
William
Fortes in fide et opere!
|
|
|
|
|
Yes
Could you use a CStringArray instead / or in addition (like build from)? If so find returns the pos of "First" and then enum from there.
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
Not without using some secondary data structure, like a map, to facilitate the conversion.
map<string, ePOS> theMap;
theMap["first"] = first;
theMap["second"] = second;
string s = "first';
ePOS p = theMap[s]; // error checking needed here, obviously
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Four fonts walk into a bar. The bartender says "Hey - get out! We don't want your type in here."
|
|
|
|
|
Thanks for replying.
I decided to use an array of the values, and check what the user entered against the values in the array, then use the relative address of the value in the array (if there was a match) and equate that with the relative value of the 'enum' variable. (Almost the same thing you were suggesting.)
William
Fortes in fide et opere!
|
|
|
|
|
Yes, it is quite same. Only when you have a lot of strings, the Michael Dunn's idea is better, because the map algorithm of matching string-type keys is quicker.
Robert-Antonio
|
|
|
|
|
I have spent the last 24 hours tracking down a heap corruption problem. I think I now know vaguely what the problem is, but it has made it clear I have no idea what I'm doing when it comes to heap usage with DLLs under windows. I am hoping some seasoned windows programmer out there can first look at my sad story below, and then either educate me as to the do's and don'ts of heap usage with DLLs under windows or point me to an article or book that will educate me. I'm not looking to be an expert, but I don't want to hit any more snafus like this one.
MY SAD STORY:
I'm working on my first windows DLL. I have an exported function that looks much like this one:
void __declspec(dllexport) getCommandString(std::string& commandString);
In case it's not obvious, usage of this function is for the application to pass in a string by reference, then some code in the DLL sets it for you.
Perhaps you already know my problem. If you do, YOU are the person I hope to hear from. But I'll finish my sad story for those of you who don't.
So I had some application code that called this function, much like this:
void doSomething()
{
std::string commandString;
getCommandString(commandString);
return;
}
doSomething() fails at the return statement with an assertion failure when memory for commandString was being freed. Digging into the stack trace I found the assertion failure was occuring somewhere in the implementation of this system call:
HeapValidate( _crtheap, 0, pHdr(pUserData) );
I read the docs for HeapValidate and discovered you could set the thrid arg to NULL to force the entire heap to be validated. So I immediately had the idea of sprinkling my own calls to HeapValidate throughout my code to track down the time when I was corrupting the heap. But then I couldn't figure out where to get the symbol _crtheap. I could see it in the debugger, but couldn't find it declared in any headers that came with VC6. So I says to myself, "I'll just hard code the address since surely _crtheap won't change values from run to run." But this caused me problems too. Eventually I figured out that that value of the global symbol _crtheap was changing within a single run! After some additional contemplation, I says to myself, "Perhaps there is more than one heap for my process!" Through additional experimentation, I now believe that my DLL is allocating and freeing memory from one heap, and my application is using another. The above functions cause memory to be allocated in the context of the DLL and freed in the context of the application (and vice-versa).
Voila! Crash!
MY QUESTIONS:
I would like someone to confirm my theorys and perhaps provide me any additional information as to the usage of heaps in DLLs. Does every DLL have its own heap? I currently believe that I must eliminate any interfaces where memory is allocated in one library context and freed in another. What if I changed the signature of my fucntion to:
std::string __declspec(dllexport) getCommandString();
Would this eliminate my problem?
Thanks much,
Matt
|
|
|
|
|
You've got it essentially right. The CRT new /delete operators alloc/free from a heap set up by the CRT. If the DLLs are linked statically to the CRT code, each DLL does its own CRT initialization, thus each gets a different heap.
To alloc memory that's availble to the whole process, use CoTaskMemAlloc() and free it with CoTaskMemFree() . This prevents you from passing a string as a param, however.
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
-- Buffy
|
|
|
|