|
Can you use the process dumper utility and set it up in a way to create a dump of your exe when it crashes...
The dump information can help in debugging. Also see and read userdump[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
It happened ones and it was not on my computer.
"I know just symtoms"
Actualy program did not crash, it pretend recording but
there was no data comming and so empty file was created.
When people looked into directory, and there were just empty
files they realize something is wrong with my program.
They just stopped it and start again and it works again correctly.
viliam
|
|
|
|
|
Can you use of MCI_RECORD?
|
|
|
|
|
Hey,
Okay, bear with me. I'm not sure if what I want to do is called "framing" but that is what I will refer to it as. Most windows in Microsoft Windows have a frame, the frame (usually) has three buttons, minimize, maximize/restore down and exit. If you click 'restore down' the window has a complete frame and can be moved by dragging the mouse. I want to be able to create a frame around a window that I resize, please note that I need to do this from a dll that I inject into a process; my code doesn't create the original window.
Below is an image of what I want to do, I really hope you understand
http://img389.imageshack.us/my.php?image=frameui4.png[^]
I'd really appreciate some help with this, I can't seem to get it working :\
Thanks for your time
modified on Thursday, October 16, 2008 4:56 AM
|
|
|
|
|
Maybe you could use SetWindowsLong + SetWindowPos (with SWP_FRAMECHANGED flag enabled).
Look:
SWP_FRAMECHANGED
Applies new frame styles set using the SetWindowLong function. Sends a WM_NCCALCSIZE message to the window, even if the window's size is not being changed. If this flag is not specified, WM_NCCALCSIZE is sent only when the window's size is being changed.
http://msdn.microsoft.com/en-us/library/ms633545.aspx
|
|
|
|
|
I want Copying the Data from an ASCII Text File on a PC Back to an Operating System Spooled File for Iseries don't use ftp.
thanks very much.
|
|
|
|
|
Please be wait till you get the response.
Do not repost the questions. It will not help you getting answers.
Also read posting guidelines before posting. Be specific about your problem.
I also see that you have posted same question in C++/CLI forum. Please do not cross post.
Regards,
Sandip.
|
|
|
|
|
But I cant wait I need to answer urgent. 
|
|
|
|
|
I want Copying the Data from an ASCII Text File on a PC Back to an Operating System Spooled File for Iseries don't use ftp.
thanks very much.
|
|
|
|
|
Hi,
I want to monitor network traffic of LAN.
Basically, my current application is continously transferring data from one computer to another on LAN. Currently i have fixed the tranfer rate i.e. in my application i have mentioned tranfer rate of 32 KB.
Now i am planning to optimize my application by changing tranfer rate dynamically.
That is, i'll calculate bandwidth of LAN and depending upon the availability i'll send data.
Please help
Thanks in Advance!!
Regards,
Tony
|
|
|
|
|
Check here[^]and here[^]
I hope it helps.
I got these using CP search ,there are few more.
Regards,
Sandip.
|
|
|
|
|
Thanks for the help but these articles explains about monitoring bandwidth of internet whereas i want for LAN.
Also i tried googling for this topic but was not successful enough.
|
|
|
|
|
What do you mean by "calculate bandwidth of LAN"?
Available bandwidth is always changing.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yeah thats what Bandwidth is always changing.
So i need to know the Bandwidth of a LAN everytime i send data.
|
|
|
|
|
You'd need to add something to your protocol so one or both
endpoints monitor throughput and adjust accordingly.
You have the data you need - time and number of bytes sent/received.
Maybe look up "network bandwidth throttling" for algorithms to interpret
that data.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
before sending info for printing using CPrintDialog how to check whether selected printer(using printer dialog) is ready to print(attached to server) .
i m using following code for printdialog call and getting selected printer name but unable to check status of selected print is there some method ??
bool bNewDlg = true;
if (m_printDlg == NULL)
{
m_printDlg = new CPrintDialog(FALSE,PD_DISABLEPRINTTOFILE);
bNewDlg = false;
}
ASSERT(m_printDlg != NULL);
if (PrinterName == NULL) {
if (m_printDlg->DoModal() == IDCANCEL) return (-1);
m_hprinter = m_printDlg->GetPrinterDC();
CString cs;
cs= m_printDlg->GetDeviceName();
m_hprinter=m_printDlg->GetPrinterDC();
if(m_hprinter==NULL)
return;
m_numCopies = m_printDlg->GetCopies ();
|
|
|
|
|
What about calling GetPrinter(hPrinter, 2, ...) ?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi all,
I am creating Win32 application in which i need to create an account with administative privileges. I am able to create an account with normal user rights.
But when i tried to create an account with administative privileges, it is giving error. So can't I create an account with admin rights directly??
Please help me out in this scenario. Any help would be greatly appreciated.
Thanks
Hemang
|
|
|
|
|
Hemang Raval wrote: it is giving error.
Don't you think that this is very vague? Are we supposed to guess the error?
Please read and understand the guidelines[^] and keep your posts in accordance. Especially, look at the 2nd and 4th points.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
I apologize for such a vague post. I had tried to make it brief but was
brief more than necessary.
BTW i got solution for my previous vague post.
My next problem is to change right of current user from administrator to limited user account . That is, i want to make current user from admin to limited account. I tried to do this with NetUserSetinfo(). But it is not working for my case.
Hope for positive reply.
Thanks,
Hemang
|
|
|
|
|
Hemang Raval wrote: I tried to do this with NetUserSetinfo(). But it is not working for my case.
You've done the same thing again. Why can't you tell us what exactly did you try and what does "not working" could possibly mean? The function failed? Did you check the return value to find out what went wrong? If not, why? The function succeeded, but did not give you expected results? Is your code perfect? Why don't you show the code?
We cannot read your mind, you see.
There's too less information in your post for anyone to give you any kind of helpful answer.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
I am sending the code snippet that i am using to change account type from admin to limited/noraml user. The user that i am trying to restrict has been created as admin.
her is the code
int getAdminNumber(int argc, wchar_t *argv[], LPWSTR user)
{
DWORD dwLevel = 2;
LPUSER_INFO_0 pBuf = NULL;
LPUSER_INFO_2 pBuf2 = NULL;
NET_API_STATUS nStatus;
LPTSTR sStringSid = NULL;
wprintf(L"\nCalling NetUserGetinfo with Servername=%s Username=%s Level=%d\n", argv[1], user, dwLevel);
nStatus = NetUserGetInfo(argv[1], user, dwLevel, (LPBYTE *) & pBuf);
if (nStatus == NERR_Success)
{
if (pBuf != NULL)
{
pBuf2 = (LPUSER_INFO_2) pBuf;
wprintf(L"\tUser account name: %s\n", pBuf2->usri2_name);
wprintf(L"\tPrivilege level: %d\n", pBuf2->usri2_priv);
if (pBuf2->usri2_priv == 2)
cnt++;
if(strcmp((char *)pBuf2->usri2_name, (char *)user) ==0)
ChangeUserPrivilege(pBuf2->usri2_name, pBuf2->usri2_priv);
}
}
else
fprintf(stderr, "NetUserGetinfo failed with error: %d\n", nStatus);
return 0;
}
void ChangeUserPrivilege(LPWSTR csUser, DWORD csPrivilege)
{
NET_API_STATUS nStatus;
USER_INFO_1005 ui1005;
DWORD dwLevel1005 = 1005;
DWORD dwPrivilege;
wchar_t *pswzUser = csUser;
if(csPrivilege == 2) dwPrivilege = USER_PRIV_USER;
ui1005.usri1005_priv = dwPrivilege;
nStatus = NetUserSetInfo(NULL,pswzUser,dwLevel1005,(LPBYTE)&ui1005,NULL);
}
I am not getting any error for above code but at the same time not getting desired output.
Any help would be greatly appreciated.
Thanks
Hemang
|
|
|
|
|
Hemang Raval wrote: I am not getting any error for above code but at the same time not getting desired output.
Hemang Raval wrote: nStatus = NetUserSetInfo(NULL,pswzUser,dwLevel1005,(LPBYTE)&ui1005,NULL);
What is the value of nStatus after the call? Is it equal to NERR_Success ?
Can you try this?
if(NetUserSetInfo(NULL, pswzUser,
dwLevel1005, LPBYTE)&ui1005, NULL)!=NERR_Success)
AfxMessageBox(_T("NetUserSetInfo() Failed!"));
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
I have console based appliacation. So i used following code to determine it.
nStatus = NetUserSetInfo(NULL,pswzUser,dwLevel1005,(LPBYTE)&ui1005,NULL);
if(nStatus != NERR_Success)
fprintf(stderr, "NetUserSetInfo failed with error: %d\n", nStatus);
And above code gives me following error.
NetUserSetInfo failed with error: 87
Any suggestion. Please help me.
Thanks,
Hemang
|
|
|
|
|
Why don't you through the documentation and find out what the error means? The return value can be one of the 9 return codes provided in the documentation in case of failure. I don't feel like offering any help if you can't even look up the documentation.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|