Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

Sparticus

@Sparticus
About
Posts
23
Topics
7
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Keeping Up
    S Sparticus

    I've been killing time by looking through a bunch of different projects on CP and started wondering: how does everyone keep up on all of the different advances in programming? Also, what is everyone's opinion on C#? I'm hesitant to take any time to learn it . . . mostly because I keep hearing "as easy as VB", or "like Java". Is it as powerful as everyone seems to suggest?

    -Michael Anderson-
    完成の円

    The Lounge question csharp java

  • Which OS are you?
    S Sparticus

    Under your bright and cheerful exterior is a strong and stable personality. You have a tendency to do more than what is asked or even desired.
    How did they do it?

    I don't want to hear any remarks about Windows XP sucking!

    -Michael Anderson-
    完成の円

    The Lounge linux csharp php asp-net com

  • Threading related question
    S Sparticus

    So what kind of blocking functions are you calling?

    If you're using Winsock you can create a non-blocking socket and check to see if a connection has been made or a message has been sent/received using the select function. If you want, this select function can 1) not block at all (not recommended) or 2)block for a set amount of time.

    If you are using sockets I would loop through: telling the select function to block for an undetectable fraction of a second, check to see if the operation has completed, and repeat until the operation either completes, is cancelled, or is timed out.

    -Michael Anderson-
    完成の円

    C / C++ / MFC question help tutorial learning

  • Upload/Download Threading GUI
    S Sparticus

    I'm creating a program that allows multiple uploads and downloads between two computers. I want to create a similar interface to the one found in LeechFTP. Hopefully someone out there is familiar with it. Using Spy++ it's apparent that the upload/download list is not a window itself. I can think of about a million ways to implement this, but was wondering what everyone else has to say about it. For those of you who haven't seen LeechFTP, it has a list of the current uploads and downloads with a progress bar and static text info for each thread. I'm also curious as to what's going on behind the scene. In my version I have a vector that holds classes that represent each upload/download in progress. Should each of these classes be able to draw the progress bar w/ static text info? How would I make this list scrollable? Thanks for any suggestions!

    -Michael Anderson-
    完成の円

    C / C++ / MFC graphics question announcement

  • Frustrating new operator problem
    S Sparticus

    Hi all. I'm trying to create a simple stack template class. Yes, I can hear your remarks about just using the STL, but I have my reasons. Anyway, I'm simply trying to allocate memory to grow the stack array, but keep getting the same runtime error:

    Unhandled exception at 0x0046a470 in StackTest.exe: 0xC0000005: Access violation reading location 0x00000000.

    The call stack currently looks like this:

    StackTest.exe!strlen() Line 78 Asm StackTest.exe!exception::exception(const exception & that={...}) + 0x31 C++ StackTest.exe!std::bad_alloc::bad_alloc(const std::bad_alloc & __that={...}) + 0x13 C++ StackTest.exe!std::_Nomemory() Line 8 + 0xd C++ StackTest.exe!operator new(unsigned int size=240) Line 15 C++ StackTest.exe!operator new[](unsigned int count=240) Line 7 + 0x9 C++ StackTest.exe!CStack::resize(unsigned int nNewSize=60) Line 75 + 0xc C++ StackTest.exe!CStack::push(int & tData=8) Line 26 C++ StackTest.exe!main() Line 33 C++ StackTest.exe!mainCRTStartup() Line 259 + 0x19 C kernel32.dll!GetCurrentDirectoryW() + 0x44

    I assume from this information that there isn't enough memory available to make the allocation, but this is only the second new call that I make from the start of the program. Also, I'm only trying to allocate 240 bytes of data. Here's the code for the resize() function: template < typename T, int INCREMENT > void CStack< T, INCREMENT >::resize( size_t nNewSize ) { > // Make sure the new size is valid if ( nNewSize == m_nCapacity ) return; else if ( nNewSize < INCREMENT ) nNewSize = INCREMENT; T *pNewStack; // Pointer to the new stack size_t nMinSize; // Minimum copy size nMinSize = nNewSize < m_nCapacity ? nNewSize : m_nCapacity; // Allocate the new stack pNewStack = new T[ nNewSize ]; // Move the old data into the new stack memmove( pNewStack, m_pStack, nMinSize*sizeof(T) ); // Deallocate the old stack delete [] m_pStack; // Point to the new stack m_pStack = pNewStack; } Class Variables: m_nCapacity = 30 m_nSize = 30 INCREMENT = 30 I appreciate any insite that anyone can provide. Thanks!

    -Michael Anderson-
    完成の円

    C / C++ / MFC c++ data-structures help performance question

  • C++ Supremacy Over Java or MS Supremacy over Borland
    S Sparticus

    That is actually a very good idea...I love templates! Thanks,

    -Michael Anderson-
    完全な円

    The Lounge c++ java delphi help question

  • What Makes C++ An Attractive Language?
    S Sparticus

    :) Works for me...

    -Michael Anderson-
    完全な円

    The Lounge c++ java visual-studio com question

  • What Makes C++ An Attractive Language?
    S Sparticus

    LOL, yeah, I've found myself incumbered by hordes of women ever since I started.

    -Michael Anderson-
    完全な円

    The Lounge c++ java visual-studio com question

  • What Makes C++ An Attractive Language?
    S Sparticus

    After all of the comments I've received from my last thread[^], I've decided that I need to rethink my topic.  I hope that everyone doesn't mind my doing this -- a web search on such issues produces a whole lot of useless garbage. Anyway, the new topic open for discussion is: As software engineers and the like, what makes C++ such an attractive language to you, and under what circumstances do you find it to be a burden? Again, I'm curious to hear what you guys have to say and if there are any articles out there that you know of that discuss the pros and cons of the language. Thanks to everyone that responded to my last thread and provided me with info on Java vs C++.

    -Michael Anderson-
    完全な円

    The Lounge c++ java visual-studio com question

  • C++ Supremacy Over Java or MS Supremacy over Borland
    S Sparticus

    Again, you're right. Perhaps I should revise my question: I need to write a technical paper on anything concerning the C++ language. So far I've ruled out the history of C++ as well as 'showing' that C++ is superior to Java even if I find myself leaning in that direction due to the material provided (minus the issue of using the right tool for the right job). Does anyone have any suggestions? Is there any particular facet of C++ that seems completely fascinating to you? Maybe I should start a new thread.

    -Michael Anderson-
    完全な円

    The Lounge c++ java delphi help question

  • C++ Supremacy Over Java or MS Supremacy over Borland
    S Sparticus

    Thanks. You're right, I've seen people persue things to the death because of their bias and not because they're right. I'm only a little guilty of doing the same. :~

    -Michael Anderson-
    完全な円

    The Lounge c++ java delphi help question

  • C++ Supremacy Over Java or MS Supremacy over Borland
    S Sparticus

    Why Java Will Always Be Slower than C++ I like it already... -Michael

    The Lounge c++ java delphi help question

  • C++ Supremacy Over Java or MS Supremacy over Borland
    S Sparticus

    Gary Wheeler wrote: Because it was a microprocessor projects class, you could choose to do either a hardware or a software project, the guy who taught it was a hardware weenie, and I did a software project. This guy enjoyed f**king me over about it. What an a**. I'm glad I haven't run into anyone that asinine yet. *knock on wood* Thanks for the suggestion. Now I just need to find a Java compiler to use at home.

    The Lounge c++ java delphi help question

  • C++ Supremacy Over Java or MS Supremacy over Borland
    S Sparticus

    Ooooh, this is some good stuff, thanks! -Michael

    The Lounge c++ java delphi help question

  • C++ Supremacy Over Java or MS Supremacy over Borland
    S Sparticus

    That definitely has some useful info. Thanks! -Michael

    The Lounge c++ java delphi help question

  • C++ Supremacy Over Java or MS Supremacy over Borland
    S Sparticus

    I'm top ranking student in the class . . . doesn't that account for anything?

    The Lounge c++ java delphi help question

  • And Quomar equals Ten
    S Sparticus

    That's no planet . . . it's a space station!

    The Lounge com question announcement

  • C++ Supremacy Over Java or MS Supremacy over Borland
    S Sparticus

    Hey guys... I've been assigned to write a technical paper on any particular subject concerning C++ for one of my college courses. I haven't really decided what the topic of the paper should be so I'm wondering if anyone here has any suggestions. (I really don't want to end up writing anything about the history of C++, so that narrows things down a little.) My instructor seems to be anti-Microsoft and I think favors Java over C++. I probably can't change his mind, but I've been thinking about writing something that'll make him think of these two things in a different light. Unfortunately I am incredibly biased in this area and therefore tend to know a great deal about C++ and MS and very little about other compilers and Java. (I have looked at Java to some degree and ended up with a bad taste in my mouth.) Could anyone direct me to some reference material? Also, I'd like to hear everyone's opinion on C++, Java, MS, Borland, etc. I appreciate your help on this... -Michael Long Live The Code Project!

    The Lounge c++ java delphi help question

  • FindResource
    S Sparticus

    Okay, to answer my own question . . . hRsrc = FindResource( NULL, MAKEINTRESOURCE( IDR_JPG1 ), "JPG" ); Corrects the problem

    C / C++ / MFC question help announcement learning

  • FindResource
    S Sparticus

    Okay, I'm trying to load the raw data of a resource of a custom type. I've named the type "JPG" and have created a resource with the ID "IDR_JPG1". The resource is located within the executable. The code that I've come up with is: char* pData = 0; HRSRC hRsrc; HGLOBAL hGlobal; DWORD dWord; hRsrc = FindResource( NULL, ?, RT_RCDATA ); dWord = GetLastError(); // Produces 1813 (ERROR_RESOURCE_TYPE_NOT_FOUND) hGlobal = LoadResource( NULL, hRsrc ); pData = (char*)LockResource( hGlobal ); I have no idea what I need to be putting in place of the question mark. The MSDN Library provides only unclear and essentially useless information. Also, I'm a little uneasy about locking up a resource and not releasing it. Do I need to release it? There is a FreeResource function but I'm told that it is depricated. I'd appreciate any info you could send my way.

    C / C++ / MFC question help announcement learning
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups