Visual C++ :: NetShareEnum - WinAPI Not Able To Remove Unnecessary Sharefolders
Apr 12, 2013
For getting the share folder name i have been used the following code , here i am able to get the folder names . But the problem what i am facing is along with the share folder created by the user it gives some extra folder also , i don't know how to prevent the programe to hide that unnecessary folder names . Like in my case i am getting "cc_views"(used for clearcase) and "Users" folders , which i want to remove from my folder lists .
I wrote the following code:
#ifndef UNICODE
#define UNICODE
#endif
#include <windows.h>
#include <stdio.h>
#include <lm.h>
#pragma comment(lib, "Netapi32.lib")
#pragma comment(lib, "Advapi32.lib")
[Code] ....
View 2 Replies
ADVERTISEMENT
Feb 28, 2013
I want to pass some parameters to a dialog. I am trying to pass a struct as LPARAM in CreateDialogParam. How to access this structure from ONOK for example?
Code:
struct DlgParam{
std::wstring IEDllPath;
CString folderName;
};
[Code] .....
View 7 Replies
View Related
Feb 28, 2013
I have made a simple Pane class so that I can encapsulate a winapi Dialog.
I call it as:
Here the code I have, but it displays no dialog.
Here is what I do in main:
Code:
Pane(&hDlg, hInstance, nCmdShow);
while((ret = GetMessage(&msg, 0, 0, 0)) != 0)
{
if(ret == -1)
return -1;
if(!IsDialogMessage(hDlg, &msg))
{
[Code]...
View 7 Replies
View Related
Feb 27, 2013
I made a dialog to have a customizable msgbox. (custom icon, custom caption on buttons). This is how I try to display an icon on the dialog but it is not working.
HICON hIcon = LoadIcon(NULL, IDI_QUESTION);
HWND hImageCtl = GetDlgItem(hDlg, IDC_STATIC);
::SendMessage(hImageCtl, STM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
//SendDlgItemMessage(hDlg, IDC_STATIC, STM_SETICON, (WPARAM) hIcon, 0);
View 5 Replies
View Related
Jul 2, 2012
I'm trying to learn how to take a screenshot using winAPI and c++.
this is what I have done so far.
Code:
#include <Windows.h>
#include <iostream>
using namespace std;
int main() {
HDC hScreenDC = GetDC(NULL);
[code]....
View 2 Replies
View Related
Jan 16, 2013
In a typical MFC application I use SetRegistryKey(_T("My_Company")); to set the root registry entry for my application. The MFC application however creates an entry by the name of executable where it stores all the settings of that application. I don't want that because we often change the name of executable and I want it read registry from the same set location. As example if my application name is Calculator.exe and Calculator_debug.exe it creates two different registry settings.
My_CompanyCalculatorsettings
My_CompanyCalculator_debugsettings.
How can I stop that?
View 1 Replies
View Related
Jul 10, 2014
I have made a calendar using a resource file and using the winapi
CALENDAR_DLG DIALOG 0, 0, 186, 95
STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU
CAPTION "Calendar"
FONT 8, "Ms Shell Dlg" {
CONTROL "", CALENDAR, "SysMonthCal32", WS_VISIBLE, 0, 0, 186, 95
}
My call back function is
BOOL CALLBACK DlgCalendar(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) {
switch(uMsg) {
case WM_INITDIALOG: {
} return TRUE;
[Code] .....
DTN_DATETIMECHANGE is not being called ? What is UMSG equal to when a date is changed in the calendar?
View 5 Replies
View Related
Oct 6, 2012
I had some software made for me by another programmer and i think he has put some sort of protection on it, so I can't use this software on any other computer apart from the one it is installed on now, how to remove this protection so I can run it off of any PC.
I have the following files in the folder.
SQLite.dll
SQLite.NET.dll
FUTautobuyer.s3db
FUT13.exe
Newtonsoft.Json.dll
SQLite3.dll
ComputerBenchmark.file
View 1 Replies
View Related
Aug 4, 2014
I have a C-based string. trying to remove some sub-string, I got at:
char str[]="alireza tavakkoli";
char* pos = strstr( str, "reza");
for(int j=pos-&str[0];j<pos-&str[0]+strlen("reza");++j)
str[j] = 7;
But I don't like the last line.isn't there a better solution?
View 7 Replies
View Related
Mar 19, 2013
I'm unable to print out or return the inputted string modified.
Code:
//ch11_9.c
//remove_spaces(char* given_string)
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
char* remove_spaces(char *given_string){
[Code]...
View 12 Replies
View Related
Apr 3, 2013
Code: /*
generals is the first array. Max 10 elements.
numGenerals is the element count of generals.
genBuff is the second array; it is to be checked/pruned.
genCount is the element count of genBuff.
genBuff will be a max of 171, but be pruned to no more than 10, and no more than the complement of the element count of generals.
*/
[Code] ....
(I do have comments in the actual source, different from above).
I have two int arrays. They hold values from 0 to 170. The first one will never be more than 10. The second will be at most 171, but will be whittled down to at most 10, usually less. 171 is worst case, most users of this particular program will probably be reasonable and not try to add all 171 (max is 10 anyway). The first array is the original array. The second array is a temporary array. Any value in the second array that is also found in the first array, is removed from the second array, since all values in the first one must be unique. After this pruning process, both arrays will collectively contain no more than 10 unique elements; the elements from the second will be added to the first.
So right now I have three nested loops. I figured with the miniscule array sizes it wouldn't be a big deal. I can think of a way to remove one or two of them, but I want to be sure that I'm still writing clean, legible, good-practice code. The first loop walks through the first array. For each element in the first array, there is a second loop to walk through the second array to check for duplicates. If a duplicate is found, the third loop walks through the second array to overwrite the duplicate while preserving the second loop's position (j).
Is this dumb? I know that the big O gets worse and worse the deeper you go with nested loops. Even though the arrays are really tiny, is this still a thing to avoid?
View 5 Replies
View Related
Jul 5, 2013
The following 2 codes are almost identical, only that the switch statements are slightly different. The 2nd code has the issue of requiring an additional enter key to be pressed when I enter '3' as input to exit the program.
Working code :
Code:
#include <stdio.h>
#include <ctype.h>
#include <string.h>
void clearKeyboardBuffer() {
int ch;
while ((ch = getchar() != '
[code]....
View 7 Replies
View Related
Jan 27, 2013
I want to a C program to delete an element from an array which can use both index method & character method
For example
input : "1 222 333 4444"
output:"1 22 333 4444"
if either index = "4" or character ="2" is entered
It should able to read in/accept any input array of varying length, and the position/index or element in array to be deleted...
View 6 Replies
View Related
Jul 18, 2013
I know how to remove digits in number from right to left.For example: the number 319. If I do (number /= 10), I get 31.how can I remove digits in number from left to right.For example: the number 319. If I will do something, I will get the number 19.
View 15 Replies
View Related
Sep 22, 2013
I had ...
class List;
List *deletezeroendlist(List* L);
class List {
public:
intdigit;
List*nextDigit;
public:
List():digit(0), nextDigit(NULL){}
List(int d, List *next):digit(d), nextDigit(next){}
I have tried many different ways but it is still not the answer / perform the function List *deletezeroendlist(List* L)
EX
L=12345600 -> L=123456
or L=01203000 -> L=01203
remove the 0 at the end
View 3 Replies
View Related
Jul 11, 2013
I suppose to have the following matrix
A). I want to remove a generic row and column. For instance the second row and column, then I get
B). How can I realize it in C?How to do.
A) B)
a00 a01 a02
a00 a02
a10 a11 a12a20 a22
a20 a21 a22
View 2 Replies
View Related
Jan 24, 2014
Below is my .h file and the code below that is my function that I'm having troubles with. Its suppose to take in a users topic and see if that topic exists, if it does exist then find the keyword, commentcompare will find where that keyword is and delete the comment. However its not deleting anything and its returning temp is NULL.
class comment //adds a comment
{
public:
comment(char * create_comment);
[Code]...
View 3 Replies
View Related
Mar 27, 2013
How can I remove an element in a list when I have only an iterator that points to the object I want to remove. Is there a build in command? remove() takes an object reference as its argument. Is it possible to convert the iterator into a pointer type so it can be deferenced and passed to remove?
This is the code I am working on:
//player.cpp
void Player::CheckCollectableCollisions(std::list<Collectable>& c) {
std::list<Collectable>::iterator i = c.begin();
while(i != c.end()) {
if (Collider::CheckCollision(pNodes_.front().getLocation(), i->getLocation()))
[Code] .....
View 2 Replies
View Related
Dec 18, 2013
I am trying to remove the first digit so if the user enters 12345 it should output 2345 the code i have works only for removing the last digit how would i go about removing the first one?
#include <iostream>
using namespace std;
int removeFirst(int n);
int main(){
int n, m;
cout << "enter number" << endl;
[Code] ....
View 4 Replies
View Related
Aug 9, 2013
I've to do a function that removes char(input by user) from string , only if it appeared and to reduce spaces.
for instance: string = abcabcd ; and the char= c/
the return string is : ababd
void removeChar(char string2[SIZE], char ch) {
//---NOTE--- its not completely works - there is a problem i.
int read = 0, write = 0;
[Code].....
View 6 Replies
View Related
Aug 15, 2014
Im supose to use <>bool removeTile(char, int, int, char[])<> to do this "function that takes in the choice (D or S) and the two dice numbers and the board as input arguments. When the move is legal and the tile is available for removal, it removes the tile according to the choice by marking the tile as ‘X’. Returns true if the move is successful."
View 4 Replies
View Related
Mar 1, 2014
I need to make a function that removes a function in a c-string. This is what I have:
#include <iostream>
using namespace std;
char removeCharacter (char *str, char c)
{
[Code].....
View 5 Replies
View Related
Jul 14, 2014
I want to remove the folder name in a string example C:/test/desktop/new folder/test.xls.i want the string "test"alone and folder may vary.
View 3 Replies
View Related
Jan 23, 2014
I have ran into some sort of Circular dependency between two classes.
Forward declaration doesn't work as I'm allocating the memory for pointer array of Student and it requires the default constructor.
P.S I'm aware I haven't written the BIG 3, it's an incomplete code. Just want to know how to resolve this dependency.
class Student;
class Course {
char *name;
Student *s[3];
[Code].....
View 14 Replies
View Related
Mar 1, 2014
i used a tab control to open form when user clicks on button of required form.. now the problem is that if form open once it can b again open using its button... how can i stop this re open problem?
View 10 Replies
View Related
Oct 11, 2012
I am writing a parse system, and I want to go in and check a string for multiple Ks to be exact a K at the beginning and one at the end, if it does have a K at the end of the string I want to remove that K. I don't have an exact size of my string. I know how to remove the last K but not how to check the string for the multiple Ks.
This is what I have:
if (poNumber.Contains("K...K"))
poNumber.Remove(poNumber.Length - 1,1);
I know that the first part will not work the way I want it to.
View 6 Replies
View Related