Showing results 1 to 31 of 31
Search took 0.01 seconds.
Posts Made By: unclepauly
Forum: C++ Sep 28th, 2008
Replies: 2
Views: 221
Posted By unclepauly
Re: passing params to CreateThread

i used new and yes it does indeed work. i wanted really to understand what was happening - so thanks for the explanation.
Forum: C++ Sep 28th, 2008
Replies: 2
Views: 221
Posted By unclepauly
passing params to CreateThread

i have a bunch of data i want to pass to CreateThread. i created a struct as per the msdn documentation. here it is:


typedef struct ThreadRecvData
{
std::list<char> data;
Ogre::String...
Forum: C++ Jun 18th, 2008
Replies: 0
Views: 243
Posted By unclepauly
exception handling in winproc

hi,

im creating a library, in which there is a winproc that is started in a function called StartMessageLoop. This function is started as a seperate thread from another function called Init. heres...
Forum: C++ Apr 6th, 2008
Replies: 9
Views: 598
Posted By unclepauly
Re: Please Help - Linked List

here's my advice. when you create pointers, always always always set them to NULL. same goes for when you delete them. in your 'replace' function, you go into a 'while temp is not NULL' loop, then...
Forum: C++ Apr 5th, 2008
Replies: 9
Views: 598
Posted By unclepauly
Re: Please Help - Linked List

temp = start_ptr;


temp is a pointer.
start_ptr is not.

do


temp = &start_ptr;
Forum: C++ Apr 5th, 2008
Replies: 9
Views: 598
Posted By unclepauly
Re: Please Help - Linked List

you have declared your NodeType constructor like this:


NodeType(NodeType newelement, long id, string nam, string pho, char stats, float inc)


so you need to make sure that each time you 'new' your...
Forum: C++ Feb 22nd, 2008
Replies: 4
Views: 384
Posted By unclepauly
Re: wierd exception handling - can someone explain ?

right im sorry i made a mistake in my code snippit above.

the catch in both instances is catch(...) which should catch EVERYTHING.

any more ideas ?
Forum: C++ Feb 22nd, 2008
Replies: 4
Views: 384
Posted By unclepauly
wierd exception handling - can someone explain ?

can someone please try and explain something to me...

i have 2 functions, lets call them FuncA and FuncB. FuncA calls FuncB, and FuncB does some stuff then simply returns. both functinos are...
Forum: C++ Jan 27th, 2008
Replies: 2
Views: 1,549
Posted By unclepauly
Re: singleton pattern and its destructor...

yes, that indeed fixes the problem, thank you.

however, i would still like to understand why that was happening. at what point does the default copy constructor get called in my sample code above,...
Forum: C++ Jan 26th, 2008
Replies: 2
Views: 1,549
Posted By unclepauly
singleton pattern and its destructor...

im making a singleton class in c++ and have a couple of questions. first, heres my .h and .cpp files:


// Singleton.h

class Singleton
{
public:
static Singleton GetSingleton();
void...
Forum: C# Sep 28th, 2007
Replies: 1
Views: 1,185
Posted By unclepauly
Re: XmlSerializer issue.

i think i found the problem, by accident.

originally, the set accessors were commented out in the properties (although they are not in the code above). this causes the value not to be serialized....
Forum: C# Sep 28th, 2007
Replies: 1
Views: 1,185
Posted By unclepauly
XmlSerializer issue.

hi,

im using this code to serialize my class into xml:


public static void Save(Class1 myClass)
{
System.Xml.XmlTextWriter w = new System.Xml.XmlTextWriter(@"./myFile.cfg",...
Forum: C++ Jul 11th, 2007
Replies: 1
Views: 1,213
Posted By unclepauly
Re: COM aggregation

ah ha,

the code assumes that the component is aggregated. if is not being aggregated then the code does not make sense, in fact i think it will recursively call QueryInterface if its not IY and...
Forum: C++ Jul 11th, 2007
Replies: 1
Views: 1,213
Posted By unclepauly
COM aggregation

I've been learning about aggregating COM objects.

I dont understand why we 'need' 2 IUnknowns (ie the delegating IUnknown and the Non-delegating IUnknown). Surely the same effect can be achieved...
Forum: C++ Jun 26th, 2007
Replies: 2
Views: 1,913
Posted By unclepauly
Re: dllRegisterServer problem

solved.

the lack of a .def file was indeed the problem.
Forum: C++ Jun 26th, 2007
Replies: 2
Views: 1,913
Posted By unclepauly
Re: dllRegisterServer problem

this also happens in VS.NET 2003.

ah ha, i used a tool to view exported functions from dlls and i can see that when i do STDAPI DllRegisterServer, the function is not exported. So im guessing this...
Forum: C++ Jun 26th, 2007
Replies: 2
Views: 1,913
Posted By unclepauly
dllRegisterServer problem

hi,

im creating a win32 dll using VS.NET 2005. actually im creating a COM component so i need to implement DllRegisterServer. The problem is that when i call regsvr32 on the dll, i get the error...
Forum: C++ Jun 23rd, 2007
Replies: 2
Views: 1,709
Posted By unclepauly
Forum: C++ Jun 23rd, 2007
Replies: 2
Views: 1,709
Posted By unclepauly
passing in ascii/unicode strings to LoadLibrary

hi,

i have this code:


HINSTANCE hComponent = ::LoadLibrary("Component1.dll");


i get this compile error:
Forum: C++ Feb 18th, 2007
Replies: 9
Views: 2,972
Posted By unclepauly
Re: callbacks and class member functions...

yes i see. bummer.

cheers though.
Forum: C++ Feb 18th, 2007
Replies: 9
Views: 2,972
Posted By unclepauly
Re: callbacks and class member functions...

well ive been doing a bit of reseach on this and it looks nasty. declaring the callback as static gets rid of the 'this' pointer, (so registering it as a callback is fine), but because of this it...
Forum: C++ Feb 18th, 2007
Replies: 9
Views: 2,972
Posted By unclepauly
callbacks and class member functions...

i have a BaseClass and a DerivedClass. i need the BaseClass to register a glut callback, but i need the DerivedClass to determine what the callback does.

heres the code:

(.h)

class...
Forum: C Jan 13th, 2007
Replies: 0
Views: 906
Posted By unclepauly
how to return a value from a thread

i am using CreateThread to, unsurprisingly, start a thread :p

is it possible to return a value? i need to return either true or false at least. ideally i need to return 0, 1 or 2 to indicate the...
Forum: Computer Science and Software Design Jan 8th, 2007
Replies: 2
Views: 1,372
Posted By unclepauly
Re: performance of some C++ apis

ok thats cool, thanks.
Forum: Computer Science and Software Design Jan 6th, 2007
Replies: 2
Views: 1,372
Posted By unclepauly
performance of some C++ apis

i am using a couple of methods to calculate the distance between any 2 points on the earths surface. the methods are the law of cosines, and the haversine formula.

the law of cosines formula uses...
Forum: Computer Science and Software Design Jan 6th, 2007
Replies: 3
Views: 1,792
Posted By unclepauly
Re: map / multimap memory requirements

thats great, thanks for your help once again...:)

(and yes it was a C++ STL map!
Forum: Computer Science and Software Design Jan 3rd, 2007
Replies: 3
Views: 1,792
Posted By unclepauly
map / multimap memory requirements

if i have a map of size 7, so something like this:

1
/ \
/ \
2 3
/ \ / \
/ \ / \
4 5 6 ...
Forum: Computer Science and Software Design Jan 2nd, 2007
Replies: 3
Views: 1,922
Posted By unclepauly
Re: (another) big O question

awesome explanation - thanks to you both for your replies.
Forum: Computer Science and Software Design Dec 31st, 2006
Replies: 3
Views: 1,922
Posted By unclepauly
(another) big O question

heres a question: i understand that array insertion is carried out in constant time - O(1) - but if the array is 2D (n*n), then would this still hold true if i wanted to insert the same value into...
Forum: Computer Science and Software Design Dec 31st, 2006
Replies: 2
Views: 1,477
Posted By unclepauly
Re: big O question

awesome - thanks!
Forum: Computer Science and Software Design Dec 28th, 2006
Replies: 2
Views: 1,477
Posted By unclepauly
big O question

if an algorithm takes a total time of T(log n + n^2), is this big O(log n + n^2) or simply big O(n^2) ?
Showing results 1 to 31 of 31

 
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 5:33 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC