|
You certainly can. But if it's in the same process, why use a pipe at all? You can use something much simpler, even a raw array, if you like, so long as you're careful about synchronization[^].
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Thanks for the info,
Actually , I have used the array in my sample program there i have to synchronize it.
Now i want to check that how to use the pipe and will it signal to read Thread automatically as it is written.
Please provide any link or sample so i could implement it in the same process.
Thanks
|
|
|
|
|
There is an article about pipes in the Code Project here[^]. Check out the Intra-process Communication part of the article, that's what you need. Hope that helps.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Thank you very much
This is exactly i wanted for.
|
|
|
|
|
No problem
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Hi,
I have application that performs some administrative activities such as hooking mouse, keyboard and some application APIs. It is running properly in Admin user i.e. the user is having full Administrative priviledges with UAC enabled and some Admin Approval mode policies enabled. But this activities will not work if I run the same application in standard user profile with with UAC enabled and some Admin Approval mode policies enabled. However, standard user will not have full admin priviledges to perform these activities.
I would like to do the same activities in standard user profile. Please let me know is there any way to implement this in VC++.
Thanks
SNI
jhghjghj
|
|
|
|
|
If your process requires elevated privileges, then it
needs to run elevated, right?
A standard user is going to need credentials to get past UAC AFAIK.
UAC wouldn't be effective if you could code your way around it.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yes u r right and I'm running this application with admin credentials i.e. built in administrator account. even though it is not loading driver in standard user profile if UAC is enabled.
jhghjghj
|
|
|
|
|
Do you just need the app to run elevated?
If so you can do that with a manifest entry.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
yes we can do that using manifest file but problem with manifest file is that, if we configure that process should run with admin credentials then it will always prompt user to provide admin PASSWORD. Please correct me if i'm wrong.
Also I tried this with sample program where i'm providing requestLevel = 'requireAdministrator' but it is not working. If you know proper way to do it pls let me know. while compiling program it gives warning that requestPriviledge tag is bypasses or not consider.
jhghjghj
|
|
|
|
|
I have ported my aplication to .Net and compile my code with manifest file. one of my application requires admin credentials so i have configured it as requestLevel = 'requireAdministrator' and while running this application it will prompt for admin password. when user provides this pass word then I am able to perform admin activities.
But i dont want to know admin password the end user. Please let me know is there any way in vista by which we can provide admin credentials to the processes without user intervention.
jhghjghj
|
|
|
|
|
Hi All
I want to create a .txt file and set it size like 10mb.Can any one give me artical.Plz help me
|
|
|
|
|
You can use of CStdioFile Class or CFile class for make file but I dont think its possible to set size. its possible with Naveen's answer.
modified on Wednesday, October 15, 2008 1:56 AM
|
|
|
|
|
Hamid. wrote: I dont think its possible to set size
it is possible with CFile::SetLength[^] function.
|
|
|
|
|
I forgot it. 
|
|
|
|
|
|
Can you tell us what are you trying to achieve? What purpose does it server to manually set the size of a file?
-Saurabh
|
|
|
|
|
See here. Use of an edit control is optional.
You may also want to look at SetFilePointer() followed by SetEndOfFile() .
"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,
I got some difficulity how to move bitmap image in my application
basically, the algorithm is like this,
I've got CDC as m_MapDC and it already being created and DrawPoint basically use for draw truck in the mapDC but the result is there is no truck in the map
However, If I use CPen class instead of using CBitmap, I can see the line is moving from one point to other point. Any body have suggestions
void Ctrainc::DrawPoint()
{
CBitmap btruck;
CBitmap *pbtruck = NULL;
pbtruck = (CBitmap*)m_MapDC.selectObject(&btruck);
m_MapDC.MoveTo(m_PrevTruckPoint.m_iX,m_PrevTruckPoint.m_iY);
//move to the new pos
m_MapDC.LineTo(m_CurrTruckPoint.m_iX,m_CurrTruckPoint.m_iY);
m_MapDC.SelectObject(pOrbtruck);
btruck.DeleteObject();
}
Regards,
Arif Liminto
|
|
|
|
|
To draw a bitmap on (x,y) position you need to:
(1) Create a memory DC, via CDC::CreateCompatibleDC .
(2) Select the bitmap into the memory DC.
(3) Use the CDC::BitBlt method.
See here [^] for a code sample.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
From the vc++ blog:
Get more done. The next version of Visual C++ is all about improving developer productivity for large-scale applications. Learn about the IntelliSense and browsing experiences, changes to the project and build system, project-less browsing, collaboration through remote symbol indexing, and custom visualization of symbolic information.
...
Yes, "10 Is The New 6" refers to the IDE, not to the compiler and libraries. The compiler and libraries have steadily improved from VC6 to VC7.0 to VC7.1 to VC8 to VC9 (to VC9 SP1, with TR1 and MFC goodies!), and I like to say that "10 Is Greater Than 9".
After PDC, we'll have VCBlog posts explaining the new compiler and library features in great detail.
So a return to a more v6-like IDE, which everyone seemed to love. Too bad it's taken 7-8 years to get there.
|
|
|
|
|
Can someone take a look at my code. I'm having some errors and do not know how to correct. Not looking for someone to give me the answer, but walk me though to better understand.
This is a compiler to compute wages.
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[ ])
{
int a = 40; //No. of hrs worked during week
float b = 12.75; //Pay rate: dollars per hour
float c = 510;
cout << a * b;
cout << c;
//Weekly wages
// read in the hours worked
cout << endl;
cout << "Number of hours worked during the week (integer) = ";
cin >> hours_worked;
// read in the pay rate
cout << "Hourly pay rate (specify two digits after the decimal point) = ";
cin >> pay_rate;
// compute wages
sum = (number of hours * pay rate);
// display the result
cout << endl;
cout << "The weekly wages are: $" << wages << endl;
return (0); // terminate with success
}
|
|
|
|
|
Exactly what errors?
Please use code tags.
|
|
|
|
|
Here are the errors.
1>assignment 3.cpp
1>c:\documents and settings\chuckie taylor\my documents\c++ assignments\assignments 3\assignment 3\assignment 3\assignment 3.cpp(38) : error C2065: 'hours_worked' : undeclared identifier
1>c:\documents and settings\chuckie taylor\my documents\c++ assignments\assignments 3\assignment 3\assignment 3\assignment 3.cpp(43) : error C2065: 'pay_rate' : undeclared identifier
1>c:\documents and settings\chuckie taylor\my documents\c++ assignments\assignments 3\assignment 3\assignment 3\assignment 3.cpp(47) : error C2065: 'sum' : undeclared identifier
1>c:\documents and settings\chuckie taylor\my documents\c++ assignments\assignments 3\assignment 3\assignment 3\assignment 3.cpp(47) : error C2065: 'number' : undeclared identifier
1>c:\documents and settings\chuckie taylor\my documents\c++ assignments\assignments 3\assignment 3\assignment 3\assignment 3.cpp(47) : error C2146: syntax error : missing ')' before identifier 'of'
1>c:\documents and settings\chuckie taylor\my documents\c++ assignments\assignments 3\assignment 3\assignment 3\assignment 3.cpp(47) : error C2059: syntax error : ')'
1>c:\documents and settings\chuckie taylor\my documents\c++ assignments\assignments 3\assignment 3\assignment 3\assignment 3.cpp(52) : error C2065: 'wages' : undeclared identifier
1>Build log was saved at "file://c:\Documents and Settings\Chuckie Taylor\My Documents\C++ Assignments\Assignments 3\assignment 3\assignment 3\Debug\BuildLog.htm"
1>assignment 3 - 7 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
|
|
|
|
|
dtaylor01 wrote: error C2065: 'hours_worked' : undeclared identifier
Start with the first one, this says you are using a variable 'hours_worked' but haven't declared what type it is. The compiler doesn't know what it is, an int, float..? You have to specify this before you use the variable (or when you use it).
|
|
|
|