Code Project » C / C++ / MFC
72 FOLLOWERS
CodeProject is a place for those who code. This section gives you a space to ask questions and queries about the code, errors, Azure DevOps, and many such resources on C and C++ .
Code Project » C / C++ / MFC
1w ago
I am seriously trying to learn more about C++_.
I did add a new class to the constructor, just following an examples , and
I do not understand why I am getting this error.
My own add is duplicate of existing , working class,
and I do no see why
it does no like the pointer.
m_serial(new QSerialPort(this),
// sequence 1` st add HERE
m_TAB_Ext(new A_BT_TAB_DIALOG_EXT)
/mnt/A_BT_DEC10/A_APR13_APR15/A_APR9_MAR7_MAR19_CLEAN/A_BT_LIBRARY/terminal_Bluetooth/mainwindow_Bluetooth_copy.cpp:3088: error: called object type 'A_BT_TAB_DIALOG_EXT *' is not a function or function pointer
mainw ..read more
Code Project » C / C++ / MFC
1w ago
I am using makefile / make DEFINES as common resource for project.
DEFINES += define PORT_CONFIGURATION
DEFINES += undefine SERIAL_SETUP
DEFINES += define STATUS_BAR
DEFINES += define TRACE_MENU
DEFINES += define TEST_SERIAL_PORT
DEFINES += define SERIAL_PORT_SETUP
DEFINES
# add Apr15
DEFINES += define DEBUG_MDI
DEFINES += define TRACE_CONSOLE
Is there a simple way to ERASE all DEFINES and start fresh?
My code has few places of DEFINES and commenting them out is impractical.
I did ask Mr Google , and the above did not work.
Thanks ..read more
Code Project » C / C++ / MFC
2w ago
I have run out of options to resolve this in another forum.
The "conclusion " was - it is a linker error...
I am asking for help to actually correct the error.
There are no other errors posted.
This is ALL (of the errors ) I have to go by.
I will be happy to provide RELEVANT info , barring " what are you trying to do...".
I am deliberately NOT adding more info , for now, I just do not want to
derail / influence your ideas of fixing it.
lib/libQt5SerialPort.so /home/nov25-1/Qt/5.15.2/gcc_64/lib/libQt5Core.so -lGL -lpthread
/usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandl ..read more
Code Project » C / C++ / MFC
2w ago
Calling break inside nested for loops breaks all loops or just the inner loop where break is found?
Do I need to do this to exit all loops?
C++
bool breakouter = false;
for(int x=0;x<count;x++)
{
for(int y=0;y<count;y++)
{
breakouter = true;
break;
}
if(breakouter)
break ..read more
Code Project » C / C++ / MFC
2w ago
If my preprocessor define / undefine code hierarchy is in this sequence:
#define TEST
#undefine TEST
#define TEST
assuming it is read "top to bottom "
is "TEST" defined ..read more
Code Project » C / C++ / MFC
3w ago
Hi I have below code written while contesting on a platform, though I find working with code but it fails with different test cases especially when Input value is 1 and no string is provided. Can anyone please help to resolve this issue ?
#include <bits stdc++.h="">
using namespace std;
string reSize(string s)
{
if(s.length() > 0)
{
std::string res;
int count =1;
for(int i =0;i<(s.length() - 1);i++)
{
if(s[i] == s[i+1])
{
count++;
}
else
{
res += s[i];
if(count > 1)
{
res += std::to_string(count);
}
count = 1;
}
}
res += s[s.length() - 1];
if(count > 1)
{
res += std::to_st ..read more
Code Project » C / C++ / MFC
1M ago
Se desea realizar una aplicación para llevar el control de las producciones que tiene una brigada de estudiantes en una empresa de cultivos varios en el mes de noviembre, la tarea es la recogida de tomates.
Es de interés para la empresa conocer.
a-Cuantas cajas de tomates se recogieron al analizar el mes.
b-En cuantos días la brigada cumplió la norma de producción. Tener en cuenta que la norma de producción es de 100 cajas.
c-La cantidad máxima de cajas recogidas.
d-La cantidad mínima de cajas recogidas.
e-El promedio de cajas recogidas en el mes.
f-Saber en cuantos días supero el promed ..read more
Code Project » C / C++ / MFC
1M ago
In C++ you have ints, variables for floating point numbers, bools. Does Assembly have the same variable differentiation? Can you move any type of variable into a register ..read more
Code Project » C / C++ / MFC
1M ago
Hi,
as learning process, i need some code (or simple sample project) that shows how to post?send message from a library (dll) to application (dialog or console). If a thread in dll sends message to app, how is the best to approach that?. Using GetMessage ..read more
Code Project » C / C++ / MFC
1M ago
//TestDll2.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl NS::A::A(int (__cdecl*)(class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >))" (__imp_??0A@NS@@QEAA@P6AHV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z@Z) referenced in function main
=====file TestDll2.cpp=====
C++
#include <iostream>
#include "..\\MyDll\\MyDll.h"
using namespace std;
using namespace NS;
int Print(string str);
int main()
{
NS::A* a = new NS::A(Print);
NS::printDlgt("Hello World!");
}
int Prin ..read more