|
an error message came up and no folder is created is their any thing must be in the path name or folder name
|
|
|
|
|
Hello,
MSDN states that,
" The CreateDirectory function creates a new directory. If the underlying file system supports security on files and directories, the function applies a specified security descriptor to the new directory. "
and find more about this see MSDN library.http://www.msdn.microsoft.com
With Regards,
R.Selvam
|
|
|
|
|
this is the code i use
=======================
CString str=m_ENEWFPATH+m_ENEWFNAME;
SECURITY_ATTRIBUTES z;
z.bInheritHandle=false;
z.lpSecurityDescriptor=NULL;
z.nLength=1000;
//VERIFY(CreateDirectory(str,NULL));
BOOL X=CreateDirectory(str,&z);
if (X)
MessageBox("Folder is Created");
else
MessageBox("Folder does not created");
|
|
|
|
|
Try
SECURITY_ATTRIBUTES z;
z.nLength = sizeof(z);
z.lpSecurityDescriptor = NULL;
z.bInheritHandle = FALSE;
instead, or pass NULL in place of &z in the first place.
Why did you pick 1000? I seriously doubt that it's the size, in bytes, of a SECURITY_ATTRIBUTES structure.
Steve S
|
|
|
|
|
thank u its working now..
Rasha
|
|
|
|
|
Hello!
Im using libpcap for linux. I have a problem with the command pcap_dump(u_char *user, struct pcap_pkthdr *h, u_char *sp). The first argument will be the result from pcap_dump_open() (the file I will write to), but the problem is that it's not a u_char result from pcap_dump_open, it is a pcap_dumper_t.
Is there a command for conversion from pcap_dumper_t to u_char?
In the tutorial the first argument can be a pcap_dumper_t value, but it will not work.
Thankful for your help,
Stefan
|
|
|
|
|
|
It was to simple to understand in the beginning, you always will do the hard way =)
just put pcap_dump((u_char*)outFile, header, packet)
|
|
|
|
|
I want to put an icon in taskbar in order to enable/disable something in my app, but i do not know how.Can anyone help me? Thanks a lot.
|
|
|
|
|
Taskbar? You mean system tray? As in down by the clock?
If so, look up the Shell_NotifyIcon function in MSDN - there are 100s of wrapper classes for adding an icon to the system tray, look on CP.
|
|
|
|
|
Yes, I meant system tray.I must enable/disable the timer in my app. Do tou have any ideea abot tis?
Thanks.
|
|
|
|
|
?? I'm not really sure what you mean. You mean a timer you have set? As in one that's set with SetTimer?
They are then stopped with KillTimer.
|
|
|
|
|
Yes, this is what i have meant.I want to do an icon in system tray .At the startup of my app i want to be disabled and when i click again on it to be enable, and so on in order to disable/enable the timer.
|
|
|
|
|
Your best bet to have a look at one of the wrapper classes that are around, there is a good one in MSDN called CTrayIcon.
The way the icon works is you give it an associated notification window, Windows then sends messages in the normal way to this window when something happens to the icon.
You could have a simple system where when you get a WM_LBUTTONDOWN message to your notification window, you check this timer - if it exists kill it, or if it doesn't set it.
You could go one stage farther and have a menu system where the first menu item is either enable or disable, then you have say an exit icon. CTrayIcon will handle all this for you - everything from putting up the menu when you right click to activativating the menu's "default" action (ie the one in bold) when you left click.
|
|
|
|
|
Greetings. As I said in the subject, all I know about Visual C++ is that I can program stuff with it. Other than that it's just confusing. Does anybody know of a tutorial that will tell me what I can do with this program and maybe get me started. I tried using the C++ documentation but I didn't understand a thing...Please Help. Thank you in advance.
"I'd love to change the world, but nobody will give me the source code."
-Anonymous
"If I were two-faced, would I be wearing this one?"
-Abraham Lincoln
|
|
|
|
|
it's recommended knowing some other programming languages before entering the beautiful world of c. i read once that about 80% of the people that would like to know how to program in c usually give up (specially when it comes to pointers!) but hang on it; i'm convinced that almost anybody can learn c by working hard.
once you've trespassed this wall, nothing will be the same again, believe me...
here's a link for ya:http://www.cplusplus.com/doc/tutorial/[^]
good luck!
Я люблю русский язикь!
|
|
|
|
|
Wow!
I believe he was asking about C++ not C, the criters are related but not the same. C is one of the easest languages to learn, although you have a point about pointers. Now I personaly recommend learning C before learning C++, because you can learn things that you may never learn as a C++ programmer.
Good job providing the link to a C++ tutorial though.
P.S. If you ment to say C++ instead of C I appoligise for this post.
INTP
|
|
|
|
|
phil:
i think the most important things at the beginning are some MFC basics so one can see something in the monitor. i had to learn c/c++ by myself and i'd rather skydive naked into a hot sea of piranha than do another big app based on SDK. it's frustating because as a beginner, you'll rather want to see sth appear quikly without two pages of code per pixel.
later on (as it happened to me), one wonders about many things in starts diggin and diggin.
even though the method i used wasn't as structurally correct as the one you've mentioned, it's recommendable so you get over these initial problems that usually often occur.
Я люблю русский язикь!
|
|
|
|
|
Windows is not a good eviroment to learn C/C++ and learning C++ via MFC is even worse. I am a self taught programmer and have been writing programs for over 15 years. The first thing someone should do, if they want to be good at it, is learn the language. MFC is great and I use it for almost my applications, but it hides what is realy going on. MFC is a frame work, one of many, and is almost entirely Windows specific. A programmer that knows the language can program in any eviroment. A programmer that just knows how to use MFC without knowing whats behind it (Windows SDK), is limiting his/her self.
By the way, your reply appears to have have nothing to do with the subject of the original question.
INTP
|
|
|
|
|
There are two ways to look at it, learning C++ via MFC is bad because it hides everything, or learning C++ via MFC is good because it hides everything. I think both are perfectly adequate. The C++ syntax is very confusing for a beginner because it is less like english than many high level languages (VB, delphi etc.) and MFC provides an entry point into the syntax. And I think because it is a high-level framework, much like VB, beginners can get into C++ and do things without seeing the enormity of the language and getting put off by the realisation of just how big a task it is to learn C++. For those who are curious, they will dig to the bottom of MFC to find how it works and is put together and start developing a proper C++ knowledge base. Doing it the other way around is very difficult because you are stepping into the cauldron of fire, where there is lots of code and little reward, many just get bored. However, it is as you say a very good way of learning, because you learn from the ground up. As you learn more, you will be able to see how MFC is put together without even looking at it. I'd say if your completely dedicated, start from the bottom and create some simple apps and figure out how it works. If your not sure about learning a language, check MFC out and see if you can get to grips with that, cos if you can't there's no point in pursing your hobby with C++.
"When I left you I was but the learner, now I am the master" - Darth Vader
|
|
|
|
|
Pointers don't make any sense when you're first learning C/C++. I know the first thing that came to mind when I first started learning pointers is that why would I want to use pointers (after all why would I want the address of some other variable or some data in memory?) Only after learning data structures, memory allocation techniques along with Windows programming and COM did pointers start making sense.
|
|
|
|
|
Thank you, this tutorial looks like it will be very usefull.
"I'd love to change the world, but nobody will give me the source code."-Anonymous
"If I were two-faced, would I be wearing this one?"-Abraham Lincoln
|
|
|
|
|
C++ is the most confusing, complex, and frustrating language I've ever tried to learn; it's also the most useful, and worth the effort. The MS documentation is completely useless unless you already know the language and the IDE, but there are some books that can help. The best I've found is Practical Visual C++ 6, by Bates & Tompkins, though I've wasted money on a lot of other books that taught me absolutely nothing (including the MS Press Visual C++ Reference Library).
Find a copy, work through the examples, and have fun. I've been trying to make sense of the language and the IDE since Visual C++ 4 was current, and made no progress whatsoever until I got this book. Now it's actually fun.
Heard in Bullhead City - "You haven't lost your girl - you've just lost your turn..." [sigh] So true...
|
|
|
|
|
Iam creating an mdi application where in if we save the page each child window would be saved under one name.How can i group several pages or child windows and save as one project under one name and when i open it i must be able to view all the child windows created in that project.
How can it be done
|
|
|
|
|
In my app, i use ADO to retrieve data from Access and i user clistctrl to show the data.
When the number of record is huge, it's very slow, then i tried to use virtual list which read data dynamically, however the performance is still bad because in OnGetDisp the data is retrived automatically, and involved in calling recordset object many many times.
After that, i try to user VB, i found that performance of ListView ctrl in mscomctrl.ocx is great (I didn't bind list ctrl with adodc object, i add the items dynamically). I note that the class name in VB is different from that in VC, for example, in VB the name is ListImages, while in VC, it's CImages. So i decide to use this control in visually c++, but there is still a problem. Because i use bitmap in the ctrl,i have to let the control to show some pics as well. and i import CImage,CImages, CPicture, CImageList class using wizzard. When i use CreateDispath to create CPicture obejct, it always failed, i suspect the ProgID is incorrect, then i use oleview to try to get the name, but i can't find it, then i tried Clsid, copy it from oleview, and it still failed to create, the error message is "the control is not registered". At last i went to try CImage, i got the same result unfortuletely.
Finnaly, i give up the wrapper class, i use import directive to get the coclass, o, my god, it still doesn't work.
Pls, help me, how to use the control and other com objects in vc, or tell me another list ctrl class to use with great performance.
I'm sorry, it's a long thread.
thank you.
I love C++
|
|
|
|
|