|
What are the definitions of CGsTypeBase and CGsUCharType ?
[edit]
I built this short program and it compiled and linked successfully:
struct CGsTypeBase
{
char foo[8];
};
struct CGsUCharType : CGsTypeBase
{
wchar_t foo[8];
};
struct CGsUShortType : CGsTypeBase
{
uint16_t foo[8];
};
struct CGsULongType : CGsTypeBase
{
long foo[8];
};
int main(
int argc,
char* argv[]
)
{
int m_MemberCount = 7;
CGsUCharType* m_s_b1 = new CGsUCharType(); CGsUCharType* m_s_b2 = new CGsUCharType();
CGsUCharType* m_s_b3 = new CGsUCharType();
CGsUCharType* m_s_b4 = new CGsUCharType();
CGsUShortType* m_s_w1 = new CGsUShortType();
CGsUShortType* m_s_w2 = new CGsUShortType();
CGsULongType* m_S_addr = new CGsULongType();
CGsTypeBase** m_Members = new CGsTypeBase*[m_MemberCount];
m_Members[0] = m_s_b1;
m_Members[1] = m_s_b2; m_Members[2] = m_s_b3;
m_Members[3] = m_s_b4;
m_Members[4] = m_s_w1;
m_Members[5] = m_s_w2;
m_Members[6] = m_S_addr;
return 0;
}
So how does that differ from your code?
[/edit]
modified 6-Jul-21 3:54am.
|
|
|
|
|
Yes, my code compiles and links successfully too. I guess it's just intellisense that has a problem. Thank you for your response.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
A wild guess: the intellisense does not think (like, instead, you assume) that m_MemberCount is equal to 7 .
"In testa che avete, Signor di Ceprano?"
-- Rigoletto
|
|
|
|
|
That's what I think as well. I'm glad to know someone else has the same idea. I did come across a few posts about that warning being incorrect.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Richard Andrew x64 wrote: CGsTypeBase** m_Members = new CGsTypeBase*[m_MemberCount];
As others have pointed out the your solution works because of the way the memory lays down.
In the above you have a declaration of a variable which has a type. And you also give the variable a value. But the declaration of the variable is a pointer. Just a pointer. Not a pointer to an array. So when intellisense sees you use it as an array it goes basically 'pointer + 1' isn't going to work. It does works because of the value and not the declaration.
I believe there is a declaration form that allows you to specify the form that would make intellisense happy but been a long time since I attempted C++ so I will leave it to someone else to come up with the form that makes the array specific.
|
|
|
|
|
Thanks for your input. I appreciate you taking the time to post.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
We can put a "u" after a numeric literal to indicate that it should be compiled as an unsigned int.
Or we can put "ll" to indicate that it should be compiled as a long long.
But what is the correct character to indicate that it should be compiled as a short?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
There isn't one. You'd have to cast it: short(0) .
EDIT: I prefer to use int16_t or uint16_t rather than assuming that's what I'll get. But if you're working with code that already uses short , go ahead and use it.
|
|
|
|
|
Thanks, Greg.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Does anyone know if it's possible to debug a user application from a Windows service, or if there is something that prevents this?
I suppose I could find out by just trying it, but I'd rather not waste time creating and installing a skeleton service just to see that it's not possible.
I'm hoping someone might know one way or the other.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Services run, by default, under the LocalService account, which is an extremely limited account. You can set your service to run as one of the predefined LocalService, NetworkService, or LocalSystem accounts, OR you can create your own account, assign privileges to it, and run your service under that account.
Note that use of LocalSystem is not recommended, as it essentially gives your service access to anything on the platform!
If you are running a debugger under a service, you may wish to allow the service to interact with the user.
Service User Accounts - Win32 apps | Microsoft Docs
LocalService Account - Win32 apps | Microsoft Docs
LocalSystem Account - Win32 apps | Microsoft Docs
NetworkService Account - Win32 apps | Microsoft Docs
Interactive Services - Win32 apps | Microsoft Docs
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
It rather depends on what you mean, and how you think a service could attach itself to a user application, and what information it could collect.
|
|
|
|
|
When writing a service, I always add a way to pass a command line parameter to run the app in debug mode as a console app. Many examples do the same thing.
In other circumstances, you can attach to the service. Without the proper architecture, this can run into timeout issues.
|
|
|
|
|
Thanks for your response. I was asking more about using the service as a debugger and having it attach to a user process.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hi,
Can some one help me?. I need to make a window with multiple viewports like in 3DS MAX with c++, Each viewport must be rendered with OpenGL with separate mouse actions
|
|
|
|
|
I suggest you read this[^] and then edit your post to provide more detail
|
|
|
|
|
|
Is it possible in the Visual Studio native debugger to navigate to a symbol's location (in disassembly view) by using the name of the symbol?
For instance, going to the start of the GetLastError() function by entering the name of it?
If so, how does one do this?
EDIT: If VS can't do this, can KDebug do it?
SOLUTION: On the Visual Studio DEBUG menu, choose New Breakpoint => Function Breakpoint and then enter the name of the DLL and the function name as such:
ws2_32.dll!socket It will place a breakpoint at the beginning of the function!
The difficult we do right away...
...the impossible takes slightly longer.
modified 2-Jul-21 22:03pm.
|
|
|
|
|
I just tried getting the address in the debug window but could not find any way to do it. But if you add a call to GetLastError and set a breakpoint at that address, the debugger will stop at the call. I am not sure what you would gain by it even if you could find the address, since you cannot step into most Window functions.
|
|
|
|
|
Richard MacCutchan wrote: I am not sure what you would gain by it even if you could find the address I must debug an executable for which I do not have the source, and I need to determine which Winsock mode it's using, overlapped I/O, completion ports, select event, etc. I figured I would do this by placing breakpoints at all of the various Winsock functions and examining the arguments being passed.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Without the source you will not be able to see very much. The debugger only works with the debug information created by the compiler and linker, and built into the PDB file. Without that and the source files you will most likely not be able to find anything.
|
|
|
|
|
Message Closed
modified 15-May-23 19:07pm.
|
|
|
|
|
Since we have no idea what you installed it is difficult to give an answer. You should check the output from the install to see what happened. You can also use the list sub-command to check what has been installed.
|
|
|
|
|
Further to what Richard has said, you can check which files were installed with dpgk -L <package> Unless you've installed a doc or lib package, you've almost certainly got an executable somewhere.
Keep Calm and Carry On
|
|
|
|
|
My doubt is about the basic theory of "or logical operator". Especifically, logical OR returns true only if either one operand is true.
For instance, in this OR expression (x<O || x> 8) using x=5 when I evalute the 2 operands, I interpret it as both of them are false.
But I have an example that does not fit wiht it rule. On the contrary the expression works as range between 0 and 8, both included. Following the code:
#include <stdio.h>
int main(void)
{
int x ;
do
{
printf("Imput a figure between 1 y 8: ");
scanf("%i", &x);
}
while ( x < 1 || x > 8 );
{
printf("Your imput was ::: %d ",x);
printf("\n");
}
printf("\n");
}
I really appreciate any helpo in order to clarify my doubt
In advance, thank you very much. Otto
|
|
|
|