Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

CString "Inhalt" weg

Empfohlene Antworten

Veröffentlicht

Hallo an alle,

Ich habe ein Problem vllt kann mir jmd helfen ;)

ALSO:

Ich hab ein prog das Werte aus der Registry ausließt und auflistet und man diese dann umsortieren kann.

Dazu brauch ich bei RegQueryValueEx den parameter LPCSTR lpValueName.

Dieses hab ich durch

CString s;

POSITION pos = NULL;

pos = m_listEnv.GetFirstSelectedItemPosition();

SelectedIndex = m_listEnv.GetNextSelectedItem(pos);

s = m_listEnv.GetItemText(SelectedIndex, 0);
dann mache ich so dies und das:
LONG retn = RegOpenKeyEx(HKEY_LOCAL_MACHINE, m_registryKey, 0L, MAXIMUM_ALLOWED, &regKey);

	try

	{

		if(RegQueryValueEx(regKey, s, NULL, &dwType, NULL, &buffersize)==ERROR_SUCCESS)

		{

			m_EnvTokEntries = 0;

			int zaehler = 0;

			puffer = (TCHAR*)calloc(buffersize+1, sizeof(TCHAR));

			if(RegQueryValueEx(regKey, s, NULL, &dwType, (unsigned char*) puffer, &buffersize)==ERROR_SUCCESS)

			{

				TCHAR* tok;

				tok = strtok(puffer, ";");

				while(tok)

				{

					alltext[zaehler] = (TCHAR*)_tcsdup(tok);

					m_EnvTokEntries++;

					alltext = (TCHAR**)realloc(alltext, ++num_strings * sizeof(TCHAR*));

					tok = strtok(NULL, ";");

					zaehler++;

				}

				UpdateData(true);

				_tcscpy(speicher, alltext[m_sollVar-1]);

				_tcscpy(alltext[m_sollVar-1], alltext[m_toVar-1]);

				_tcscpy(alltext[m_toVar-1], speicher);

				*speicher = _T('\0');

				zaehler = 0;

				while(zaehler<m_EnvTokEntries)

				{

					_tcscat(speicher, alltext[zaehler]);

					zaehler++;

			                        if(zaehler<m_EnvTokEntries)

		/*HIER*/			_tcscat(speicher, ";"); // <----HIER beim 4. durchlauf

				}

				if(RegSetKeyValue(regKey, s, NULL, dwType, speicher, buffersize)==ERROR_SUCCESS)

					MessageBox("Values have been transponsed.", "Hooray!", MB_OK|MB_ICONSTOP|MB_SETFOREGROUND);

			}

		}

		m_toVar=0;

		m_sollVar=0;

		UpdateData(false);

		if(alltext != NULL)

			free(alltext);

		if(puffer!=NULL)

			free(puffer);

	}

	catch(...)

	{

		MessageBox("Invalid pointer exception!\n Error reading files filter list.", "ProcessView", MB_OK|MB_ICONSTOP|MB_SETFOREGROUND);

	}

	RegCloseKey(regKey);

In der letzen Schleife (Siehe Kommentar^^) beim 4. Durchlauf ist auf einmal mein "s" nur noch "mist", wenn ich aus der schleife draußen bin steht nix mehr in meinem CString :( woran kann des liegen? Bin für jeden vorschlag offen :)

Danke schon mal im voraus :)

Schönen Tag noch allen dies Lesen :)

lg

_Faby_

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.