|
Victor Nijegorodov wrote: What is it?
Spam.
|
|
|
|
|
Check that your .vcxproj files are there. If they are, check the Properties of your project(s) to see if their dependencies are correct and if they generally make sense.
|
|
|
|
|
Weird, never figured it out. Pulled the project from a zip file, and it built.
Appreciate all the suggestions.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
charlieg wrote: What am I missing? Presidents shouldn't be compiling software. You need a software developer. 
|
|
|
|
|
lol, true. I'm also the treasurer. It's oh dark thirty here and thanks for the laugh.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
This is what is in the Build tab: image-2022-04-22-062801040 — ImgBB[^]
This code lives on a VM that was migrated into a zero trust cloud. I can go back to the original VM, and 2015 there has the full build menu.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
As I recall, Visual Studio has never supported working with solutions that are located on network/remote drives.
Are you working with Visual Studio on the virtual machine where the solution resides?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
No, I just RDP into it. Nothing too fancy.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
A STL container is not your typical c++ class, how do you declare a vector pointer and pass it to a function.
class someclass
{
public:
int ID;
}
void somefunction(vector<someclass>* vec)
{
someclass scitem;
vec->push_back(scitem);
}
vector<someclass>* vec;
somefunction(vec);
I`m also not sure how a vector of pointers would work.
void somefunction(vector<someclass>* vec)
{
someclass * scitem;
scitem = (someclass*)malloc(sizeof(someclass));
vec->push_back(scitem);
}
vector<someclass*>* vec2;
somefuntion(vec2);
|
|
|
|
|
Yes, STL containers are just template classes and can be manipulated the same as any class objects. And as such, a vector may contain objects, or pointers to objects. But remember in the second case that the items pointed to, must not be removed while the vector still owns them.
std::vector<char*>* pMyvec = new std::vector<char*>(); pMyvec->push_back("A string");
pMyvec->push_back("Another string");
int result = myfun(pMyvec);
BTW you should not use malloc in C++ code, as new and delete is the correct way to manage memory.
|
|
|
|
|
Quote: And as such, a vector may contain objects, or pointers to objects
But when you add a class object, the vector doesn`t make a copy of the object, it creates a pointer to the object being added. A linked list deals with pointers not objects.
|
|
|
|
|
If you add an object to an STL container (vector , list , set , map ...), the object is copied into the container. The objects must all be of the same type, however. The only way to put polymorphic objects into a container is to use a container of pointers to their common base class, in which case the objects need to survive outside the container, probably by having been allocated from the heap.
modified 16-Apr-22 7:34am.
|
|
|
|
|
thanks Greg, I`ll keep that in mind.
|
|
|
|
|
CalinNegru wrote: when you add a class object, the vector doesn`t make a copy of the object, it creates a pointer to the object being added. No, the vector copies whatever type you have declared it with. For example:
std::vector<std::string> myVec;
std::string newstr = "A string";
myVec.push_back(newstr);
CalinNegru wrote: A linked list deals with pointers not objects. Well sometimes it does; but what has that to do with this question?
|
|
|
|
|
ok, I think I get your point
|
|
|
|
|
I am using the attached code , originally written in C , and receiving an error - related to usage of BDADDR_ANY macro - I do not understand
and do not know how to fix it.
Here is BDADDR_ANY macro
#define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}})
#define BDADDR_ALL (&(bdaddr_t) {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}})
#define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}})
\<pre>
struct sockaddr_rc loc_addr;
struct sockaddr_rc rem_addr;
char buf[1024] = { 0 };
int s, client, bytes_read;
socklen_t opt = sizeof(rem_addr);
s = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
loc_addr.rc_family = AF_BLUETOOTH; loc_addr.rc_bdaddr = *BDADDR_ANY;
/mnt/sde5/QT_PROGRAMS_FULL/MDI_BT/MDI_BT/SUB_FT857/mainwindow_sub_ft857.cpp:106: error: taking address of rvalue [-fpermissive]
In file included from /mnt/sde5/QT_PROGRAMS_FULL/LoCAL_SOURCE/BT_Utility_Library/concurrent.h:15,
from /mnt/sde5/QT_PROGRAMS_FULL/MDI_BT/MDI_BT/SUB_FT857/mainwindow_sub_ft857.h:17,
from /mnt/sde5/QT_PROGRAMS_FULL/MDI_BT/MDI_BT/SUB_FT857/mainwindow_sub_ft857.cpp:1:
/mnt/sde5/QT_PROGRAMS_FULL/MDI_BT/MDI_BT/SUB_FT857/mainwindow_sub_ft857.cpp: In member function ‘int MainWindow_SUB_FT857::Connect(QString)’:
/mnt/sde5/QT_PROGRAMS_FULL/MDI_BT/MDI_BT/SUB_FT857/mainwindow_sub_ft857.cpp:106:27: error: taking address of rvalue [-fpermissive]
106 | loc_addr.rc_bdaddr = *BDADDR_ANY;
| ^~~~~~~~~~
actually there is another take on this error
" taking address of temporary value..."
( not sure why they differ )
loc_addr.rc_channel = (uint8_t) 1;
bind(s, (struct sockaddr *)&loc_addr, sizeof(loc_addr));
listen(s, 1);
client = accept(s, (struct sockaddr *)&rem_addr, &opt);
ba2str( &rem_addr.rc_bdaddr, buf );
fprintf(stderr, "accepted connection from %s\n", buf);
memset(buf, 0, sizeof(buf));
bytes_read = read(client, buf, sizeof(buf));
if( bytes_read > 0 ) {
printf("received [%s]\n", buf);
}
Please any help to resolve this coding issue will be much appreciated.
|
|
|
|
|
|
You are trying to dereference the BDADDR_ANY structure. You should just take the value, which is already the address.
loc_addr.rc_bdaddr = BDADDR_ANY;
|
|
|
|
|
// Server side C/C++ program to demonstrate Socket programming
#include <unistd.h>
#include <stdio.h>
#include <sys socket.h="">
#include <stdlib.h>
#include <netinet in.h="">
#include <string.h>
#define PORT 8080
int main(int argc, char const *argv[])
{
int server_fd, new_socket, valread;
struct sockaddr_in address;
int opt = 1;
int addrlen = sizeof(address);
//int addrlen;
char buffer[1024] = {0};
char *hello = "Hello from server";
// Creating socket file descriptor
if ((server_fd = socket(AF_INET, SOCK_STREAM, 0)) == 0)
{
perror("socket failed");
exit(EXIT_FAILURE);
}
// Forcefully attaching socket to the port 8080
if (setsockopt(server_fd, SOL_SOCKET, SO_REUSEADDR | SO_REUSEPORT,&opt, sizeof(opt)))
{
perror("setsockopt");
exit(EXIT_FAILURE);
}
address.sin_family = AF_INET;
address.sin_addr.s_addr = INADDR_ANY;
address.sin_port = htons( PORT );
// Forcefully attaching socket to the port 8080
//if (bind(int sockfd, const struct sockaddr *addr,
// socklen_t addrlen)<0))
//if (bind(int server_fd,(const struct sockaddr *)&address,sizeof(address))<0)
if (bind(server_fd, (struct sockaddr *)&address,sizeof(address))<0)
{
perror("bind failed");
exit(EXIT_FAILURE);
}
if (listen(server_fd, 3) < 0)
{
perror("listen");
exit(EXIT_FAILURE);
}
if ((new_socket = accept(server_fd, (struct sockaddr *)&address,
(socklen_t*)&addrlen))<0)
{
perror("accept");
exit(EXIT_FAILURE);
}
valread = read( new_socket , buffer, 1024);
printf("%s\n",buffer );
send(new_socket , hello , strlen(hello) , 0 );
printf("Hello message sent\n");
return 0;
}
|
|
|
|
|
Your code compiles fine on my Linux box (GCC 9.4 ).
"In testa che avete, Signor di Ceprano?"
-- Rigoletto
|
|
|
|
|
|
You are welcome.
"In testa che avete, Signor di Ceprano?"
-- Rigoletto
|
|
|
|
|
System.DirectoryServices.dll file has been added successfully to Visual C++ MFC project through References in Solution Explorer.
Microsoft Development Environment 2003 Version 7.1.3088.
Microsoft .Net Framework 1.1 Version 1.1.4322
using namespace System::DirectoryServices;
void CClassName::MethodName(){
...
DirectorySearcher* directorySearcher = new DirectorySearcher();
directorySearcher->ClientTimeout = 60000;
...
}
file.cpp(1701): error C2061: syntax error : identifier 'DirectorySearcher'
file.cpp(1701): error C2065: 'directorySearcher' : undeclared identifier
file.cpp(1701): error C2065: 'DirectorySearcher' : undeclared identifier
file.cpp(1702): error C2227: left of '->ClientTimeout' must point to class/struct/union
type is ''unknown-type''
file.cpp(1268): error C2653: 'System' : is not a class or namespace name
file.cpp(1268): error C2871: 'DirectoryServices' : a namespace with this name does not exist
file.cpp(1702): error C3861: 'directorySearcher': identifier not found, even with argument-dependent lookup
By this way I need to set Request Timeout for SOAP WebService
modified 2-Apr-22 8:04am.
|
|
|
|
|
|
It is .Net:
Microsoft Development Environment 2003 Version 7.1.3088.
Microsoft .Net Framework 1.1 Version 1.1.4322
Visual C++ MFC:
When I add to References System.DirectoryServices.dll it refuses to add not 1.1.4322 version of it,
only System.DirectoryServices.dll of 1.1.4322 version
|
|
|
|
|