|
Yes that PC also in the network. I can connect via run mode.
|
|
|
|
|
What does that mean? Please collect some proper technical detail about your issue. Show us the code, and the connection details, and any error messages.
|
|
|
|
|
hi,
I tried to read raw picture characterized by:
16 bit
widht = 512
height = 512
grayscale
I used the c ++ function fopen and fread
the image displayed using false value
|
|
|
|
|
dahraoui wrote: I used the c ++ function fopen and fread
the image displayed using false value Okay, and?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
i resolved the problem thanks
|
|
|
|
|
Hi,
i have a tool which generates some code, so i cannot place the include at the top of the file.
case ID_ONE:
if (id == 1)
{
#include "Func.h"
Func();
}
if (id == 2)
{
Func();
}
break;
I get the following error:
incompatible implicit declaration of function 'Func'
If i remove the #include then it compiles with a warning (implicit declaration). Is it not legal to #include in if statements?
|
|
|
|
|
You did not mention which line produced the error; I would guess the second one, which does not 'see' the include file. You need to move the #include statement outside the if clause.
|
|
|
|
|
This won't work.
Include statements are processed by the C/C++ preprocessor[^] which is executed as first build step before compilation. But the if condition is processed when your application is executed.
It is possible to use include statements somewhere inside the code. But then the file content must be valid code only (imagine what the statement does: It replaces the statement with the file content).
|
|
|
|
|
It is legal but probably doesn't do what is expected (by you).
Suppose "Func.h" is
double Func();
Then, what you get (after preprocessor pass) is:
case ID_ONE:
if (id == 1)
{
double Func();
Func(); }
if (id == 2)
{
Func(); }
|
|
|
|
|
elelont2 wrote: i have a tool which generates some code
I question that statement. Certainly the professional code generation tools that I have used allow for customization which would always include a way to provide includes.
If it an in-house tool then obviously the way to go would be to modify it.
However an alternative would be to create your own simple tool which does nothing but insert a header. It is probably possible to do this with existing tools and an appropriate command line script. Even simple file concatenation might be sufficient. Then once you have that methodology down modify your build to do that step after code generation but before the compile.
|
|
|
|
|
Hi,
i cannot figure this out:
typedef struct
{
int a;
int b;
} CARPIC;
const CARPIC const* CarPics[] =
{
&Audi,
&BMW,
&Bugatti,
}
void GetCarPicture(CARPIC** carPicture)
{
int carId= GetCarId(); *carPicture = CarPics[carId];
}
CARPIC* car;
GetCarPicture(&car);
I get the warning:
warning: assignment discards qualifiers from pointer target type
I tried to add the const keyword to the GetCarPicture function parameter but could not figure out where to add it. I need to get the pointer to the const car picture.
Regards.
|
|
|
|
|
This would make more sense:
typedef struct
{
int a;
int b;
} CARPIC;
CARPIC Audi = { 1, 2 };
CARPIC BMW = { 1, 2 };
CARPIC Bugatti = { 1, 2 };
CARPIC const* CarPics[] =
{
&Audi,
&BMW,
&Bugatti,
};
const CARPIC* GetCarPicture(int carId)
{
return CarPics[carId];
}
CARPIC const* car;
car = GetCarPicture(2);
|
|
|
|
|
It should be
void GetCarPicture(const CARPIC const * * carPicture)
{
}
const CARPIC const * car;
GetCarPicture(&car);
|
|
|
|
|
Thanks, worked great, will try to figure out what gets consted...
|
|
|
|
|
|
The two const s are duplicate. Both refer to the CARPIC value. Neither refers to the pointer.
You might also want to check out my comment to CPallinis response in this thread.
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|
|
These second const s don't appear to make sense: both refer to the CARPIC value, neither refers to the pointer holding the address. That's also what my compiler states (in a warning).
To give some examples:
const int *a; int const *a; const int const *a; int *const a; const int * const a;
See also http://cdecl.ridiculousfish.com/?q=const+int+*+const+*+a%3B[^]
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|
|
|
How do I recover what's left of a file that has been deleted but not completely over written?
Let's say the deleted file is 10mb
5 of those have been overwritten
I want to restore the remaining 5.
Thanks!
|
|
|
|
|
Use Google to find a free application to do it. It is a complex process and requires a detailed understanding of the filesystem where the file was created.
|
|
|
|
|
|
Hi all. I have a doubt: how ulSize data buffer size should be:
CString sValue;
ULONG ulSize = _MAX_PATH;
lRet = RegQueryValueEx(hKey, NULL, NULL, NULL, (BYTE*)sValue.GetBuffer(_MAX_PATH), &ulSize);
sValue.ReleaseBuffer();
or
CString sValue;
ULONG ulSize = _MAX_PATH * sizeof(TCHAR);
lRet = RegQueryValueEx(hKey, NULL, NULL, NULL, (BYTE*)sValue.GetBuffer(_MAX_PATH), &ulSize);
sValue.ReleaseBuffer();
I guess that ulSize should be _MAX_PATH * sizeof(TCHAR); like in the second code ... but I am not sure ... can you tell me how is right ?
Thank you.
modified 8-Apr-15 5:37am.
|
|
|
|
|
From MSDN RegQueryValueEx function[^]:
Quote: lpcbData [in, out, optional]
A pointer to a variable that specifies the size of the buffer pointed to by the lpData parameter, in bytes. So it must be the second version.
|
|
|
|
|
|