CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: salem_c

Page 1 of 6 1 2 3 4

Search: Search took 0.02 seconds; generated 23 minute(s) ago.

  1. Replies
    1
    Views
    697

    Re: OpenMP compute pi

    Yeah, you're not calculating PI at all.

    You need to flag your result as being shared between multiple threads, otherwise you're losing updates to it.


    #include <iostream>
    #include <omp.h>...
  2. Re: LNK2019 linker error when initializing an object

    > I haven't touched C++ (especially templates) for some time and feel rusty.
    And yet you continue to ignore what people are telling you.

    Let's make it easy for you.

    Go back to your original...
  3. Re: LNK2019 linker error when initializing an object

    > But they are... aren't they?
    No, they're all in your queueType.cpp file.
    Copy the contents of your queueType.cpp into your queueType.h file.


    > Also, why is this issue a problem when linking...
  4. Re: LNK2019 linker error when initializing an object

    All your templates need to be in the .h file.
  5. Replies
    11
    Views
    1,380

    Re: Noob question: Don't know how to build this.

    Various Microsoft debuggers (WinDbg, CDB) are available to install separately, without dragging in the whole of visual studio.
    ...
  6. Replies
    2
    Views
    1,038

    Re: MFC mouse click coordinates

    The first question is, can you do it before the image has scrolled?
  7. Re: if statement being ignored despite conditions being true

    int menuSel; //menu selection input
    char menuSel2; //alternative menu selection for characters
    ..
    cin >> menuSel;
    ..
    if (menuSel == 2) {
    cin >>...
  8. Re: ShellExecute tries to launch .exe everytime even though it is already runniong.

    > ShellExecute( NULL, NULL, "DCPProbe.exe", parameters, progDir, SW_SHOWNORMAL );

    DCPProbe.exe is getting it's parameters via main(argc,argv)
    You have no choice but to start another process given...
  9. Re: No such file or directory with Hello World!

    So can you paste your console output of a build attempt?
  10. Re: No such file or directory with Hello World!

    Perhaps get rid of the spaces, dots and forward slashes.



    "-I ${fileDirname}\\include",


    Although since you're using gcc, it probably also understands forward slashes, even though it's...
  11. Replies
    9
    Views
    3,795

    Re: ::cryptDecrypt Fails with Unicode

    >if(!::CryptDecrypt(m_hKey, NULL, TRUE, 0, pData, &dwDataLength))
    If you run it in the debugger, put a breakpoint here, what is the value of dwDataLength?
  12. Replies
    9
    Views
    3,795

    Re: ::cryptDecrypt Fails with Unicode

    https://learn.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-cryptdecrypt

    Not that it shouldn't work, but if you're planning to use this for production s/w, you might need to consider...
  13. Re: trying to get Database Programming with C/C++, by Manoj Debnath July 11, 2016

    db_conn = mysql_real_connect(db_conn, HOST.c_str(), USER.c_str(),
    PASSWORD.c_str(), DATABASE.c_str(), 0, NULL, 0);

    The problem here is you trash your db_conn if...
  14. Re: Using npcap libs to save packet causes memory fault

    > Watch endiness!
    That's what the ntoh function deals with.

    Assuming the documentation for that field says "this ushort is in network byte order", then ntohs is just going to do it's thing and...
  15. Re: Using npcap libs to save packet causes memory fault

    Assuming you don't come unstuck with a bus error due to bad pointer alignment (not an issue on x86), you want something like

    shortTTL = ntohs(*((u_short*)ptrCurrent_Field));

    The red part casts...
  16. Re: Using npcap libs to save packet causes memory fault

    > The sample Npcap code didn't do that and that's how I started off.
    Some URLs to say the library you're using and it's documentation and examples would be really useful about now.
  17. Re: Using npcap libs to save packet causes memory fault

    You can make a start by running valgrind, and fixing any memory errors (buffer overruns, use after free).

    An example.


    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>

    char...
  18. Re: Using npcap libs to save packet causes memory fault

    > so even just opening a .pcap file causes the problem.
    No, opening the file exposes the problem.

    The problem already existed, it's just that you managed to avoid it killing your program up until...
  19. Replies
    3
    Views
    2,869

    Re: Searching for something in visual basic vb6

    Use the forum search.
    36095
  20. Replies
    3
    Views
    3,826

    Re: Constructor for derived class

    I thought it looked familiar!
    This just became 90% a repost bot where this is just bait for some spammy links.
  21. Replies
    3
    Views
    3,826

    Re: Constructor for derived class

    > MyNPT.cpp
    The function isn't a member of the class.



    void MyNTP::MyNPT(UDP& udp)
    : NTPClient(udp)
    {
    }
  22. Replies
    5
    Views
    4,772

    Re: code to generate a sine wave

    That's a good start.

    Perhaps these will help you.
    https://stackoverflow.com/questions/1451606/programably-make-and-play-a-sound-through-speakers-c...
  23. Replies
    5
    Views
    4,772

    Re: code to generate a sine wave

    > a c++ download to generate a sine wave and play through my PC sound card
    So how much do you want to skip the actual learning?

    Just downloading an answer, even if you study the source code in...
  24. Thread: Sqlite / C++

    by salem_c
    Replies
    5
    Views
    6,922

    Re: Sqlite / C++

    At a guess, not all the wrappers are the same.

    Try breaking the requests up.


    void ClegisView::OnBnClickedButton()
    {
    querySQL = "DELETE FROM legis WHERE n_ord = " +ord+ "";
    ...
  25. Thread: Sqlite / C++

    by salem_c
    Replies
    5
    Views
    6,922

    Re: Sqlite / C++

    https://www.sqlite.org/c3ref/exec.html
    1. It returns a result.
    You should examine the result to see if it tells you anything.

    2. err is a pointer to an error message. What does it say?
    ...
Results 1 to 25 of 126
Page 1 of 6 1 2 3 4





Click Here to Expand Forum to Full Width

Featured