|
HI Aseem,
Good to know that you solved your issue.
alternatively you can elevate run prompt from Task Manager.
Go to TaskManager
click on Processes Tab
Click on Show process from All users
Go to File Menu->New Task
This allows the execute command in admin mode.
Thanks
Prashanth
|
|
|
|
|
when i complier these codes, the warning will come :
static void err_doit(int errnoflag, int level, const char* fmt, va_list ap)
{
int errno_save, n;
char buf[MAXLINE+1];
errno_save = errno;
#ifdef HAVE_VSNPRINTF
vsnprintf(buf, MAXLINE, fmt, ap);
#else
vsprintf(buf, fmt, ap);
#endif
n = strlen(buf);
if(errnoflag)
snprintf((char*)(buf+n), MAXLINE-n, ";%s", strerror(errno_save));
strcat(buf, "\n");
if(daemon_proc)
{
syslog(level, (const char*)buf);
}
else
{
fflush(stdout);
fputs(buf, stderr);
fflush(stderr);
}
return;
}
</pre>
the warnning is:
In file included from str_cli.c:2,
from tcpcli01.c:2:
error.c: In function ‘void err_doit(int, int, const char*, char*)’:
error.c:98: warning: format not a string literal and no format arguments
i this warning, for i don't make buf to (const char*), but i try, it don't work.
please give me some advices, thank you
|
|
|
|
|
The specification for syslog() is
void syslog(int priority, const char *format, ...);
and your call uses buf as the format parameter, but its content does not contain any format control characters, and your call does not include any parameters. If you rewrite it as
syslog(level, "%s", buf);
it should work OK.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
I do an example to emulate keyboard with SendInput. Here is the code to press "a" with "dwFlags = KEYEVENTF_UNICODE".
Code:
INPUT inp[2];
memset(inp,0,2*sizeof(INPUT));
inp[0].type = INPUT_KEYBOARD;
inp[0].ki.dwFlags = KEYEVENTF_UNICODE ;
inp[0].ki.wScan = "a";
inp[1] = inp[0];
inp[1].ki.dwFlags |= KEYEVENTF_KEYUP;
SendInput(2, inp, sizeof(INPUT)); // Press "a"
Do you know how to press "a" with dwFlags = 0 and ki.wVk = "virtual key of a" ?
Thanks and regards.
|
|
|
|
|
Hi all,
I am developing a project like abode reader, I have a problem:
I need to display the ".pdf" file in the full screen model, and I have no idea to implement it.
Did anyone do it or could you tell me the main idea?
Thanks in advance.
|
|
|
|
|
Do you want to implement another PDF reader from scratch? or do you want to use Acrobat to show a PDF in full screen?
--
Si dos montan un caballo, uno debe ir detrás.
|
|
|
|
|
Yeah, I'm making my own application to implement adboe reader, now I need some thought how to
complete the full screen model.
|
|
|
|
|
See here[^] for the options to resize your window.
However, if you are saying that you have no idea how to write a PDF reader then I suggest you do some research into the PDF libraries that are available. There may also be some articles here on CodeProject that show you the basics.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Thank you, guys. I am making my own pdf reader, if you have some links to resource or source code, I should really thank you!
|
|
|
|
|
Did you read my answer? I have given you some suggestions how to find free libraries to handle PDF files. You can also get the full PDF specification from the Adobe web site and code the whole thing yourself.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
I think you can just launch PDF reader( using shellexecute or similar apis) with the pdf file name as arguemnt. you can also set the screen mode(maximaized ,minimaized , or normal ) in there.
If you want to launch PDF in your app, try PDF activex , or you can use std web browser control to shows the pdf.
hopes this helps.
If u can Dream... U can do it
|
|
|
|
|
Thank you, but I have a application that parse .pdf and other files, so I want to implement the
full screen model in my own frame, so I need some main ideas about this function.
|
|
|
|
|
This is something else I gave you a link for in my answer above. Try reading the link and see how easy it is to show your window in full screen mode.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
these code is :
int sum(int a, int b);
#include "In.h"
int sum(int a, int b)
{
return (a+b);
}
//test05.cpp
#include "iostream"
#include "In.h"
using namespace std;
int main()
{
int a = sum(1, 2);
cout << a << endl;
}
when i complier test05.cpp, it will have a question :
~/cpp/test$ g++ -o test05 test05.cpp
/tmp/ccW55H4p.o: In function `main':
test05.cpp text+0x19): undefined reference to `sum(int, int)'
collect2: ld returned 1 exit status
give me some advides
thank you
|
|
|
|
|
You need to include In.cpp in your build thus:
~/cpp/test$ g++ -o test05 test05.cpp In.cpp
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
|
You're welcome. If you get bored some dark night you might want to read some of the documentation on g++ , I think g++ --help gives you quite a lot of information.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Dears,
Could you please clarify whether the InterlockedIncrement API can be used in interprocess communication?
Regards,
Krishnakumar
|
|
|
|
|
In my opinion you can definitly use it. It provides synchronized access to a variable that is shared by multiple threads. In interprocess communication and to handle variables in shared memory it is safe.
|
|
|
|
|
InterlockedIncrement This API increments the variable value by 1, in addition to this, it also gives thread safety while incrementing so that we need not to write thread synchronization code just to increment counter. Now this behaviour you can use where ever you find it useful.
Thanks,
Anand.
|
|
|
|
|
Hey folks,
Anyone know what I need to do to get the tab key to move from field to field in a CPropertyPageImpl-based property sheet page? it works fine in design view in VS, but sounds a bell and stays put when executing. All the necessary controls have the WS_TABSTOP set, but the focus doesn't move...
Thanks!
D. T. Doutel
|
|
|
|
|
i'm not so familar with wtl - but it sounds cause the IsDialogMessage() function is callin' twice.
override the TranslateAccelerator function to set the focus by your own. because windows cannot (will) set focus among nested dialogs. but i'm not shure if there isn't a possibility to do that on another way.
|
|
|
|
|
I'll look into that; thank you!
D.T. Doutel
|
|
|
|
|
Hi,
Your message loop must call PropSheet_IsDialogMessage() when the PropSheet is not modal.
For instance in a parent frame deriving from WTL::CMessageFilter :
virtual BOOL PreTranslateMessage(MSG* pMsg)
{
return CFrameWindowImpl<CMainFrame>::PreTranslateMessage(pMsg) ? TRUE :
PropSheet_IsDialogMessage(<My Property Sheet member>.m_hWnd, pMsg);
}
cheers,
AR
When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)
modified on Friday, December 10, 2010 5:07 AM
|
|
|
|
|
I have this :
struct struct_X
{
struct_X() :
nX(0)
{
}
int nX;
CString m_strName;
};
struct_X *ptrX1=NULL;
struct_X *ptrX2=NULL;
i have a loop like this :
for(int Idx = 0; Condition; Idx++)
{
...
...
if(nCount==0)
ptrX1= new struct_X;
else
ptrX1=ReallocArray((nCount+1), nCount, ptrX2); // copy the content of ptrX2 to ptrX1 and delete ptrX2 (**)
if(ptrTmp==NULL)
break;
ptrX2=ptrX1;
ptrX2[nCount].nX = 1;
ptrX2[nCount].m_strName = strTempName; // Here I have an a crash related to CString acces violating
nCount++;
}
in the first loop ( nCount = 0) there is no problem
but after the ReallocArray (**) i get the problem in ptrX2[nCount].m_strName
Have any one idea how to solve this?
|
|
|
|